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:
Process.Start(@"c:\myPath");
Using Process.Start directly on a path may throw an exception if the process is not there.
*
unfortunately this is not working .
change: string arg = “/select ” + path;
to: string arg = “/select,” + path;
and it works
Thanks jm .. its works … 🙂
Post is updated with the fix from @jm
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.