Open and select file or folder with Explorer in C#

By , last updated January 16, 2016

This code will open Explorer and select the file or folder given.

static void openInExplorer(string path)
    string cmd = "explorer.exe";
    string arg = "/select, " + path;
    Process.Start(cmd, arg);

Read also: Build folder explorer with c# .Net


  1. dstranger May 15, 2012 Leave a Reply

    unfortunately this is not working .

  2. jm January 28, 2013 Leave a Reply

    change: string arg = “/select ” + path;
    to: string arg = “/select,” + path;

    and it works

  3. Priya February 7, 2015 Leave a Reply

    Thanks jm .. its works … 🙂

  4. kent February 7, 2015 Leave a Reply

    Post is updated with the fix from @jm

  5. Manu August 11, 2015 Leave a Reply

    This will work fine. but this will create exploere.exe process in task bar. that is big issue. if u want to use it in application for long term and open 15 file using this method. then it will start 15 explorer.exe process.

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>