Open and select file or folder with Explorer in C#

By , last updated September 13, 2019

C# Process.Start method 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);

In this example we have explicitly specified that the process to start is explorer.exe.

Process.Start method may also be used directly like this:


Using Process.Start directly on a path may throw an exception if the process is not there.


  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>