How can I open Windows Explorer to a certain directory from within a WPF app? How can I open Windows Explorer to a certain directory from within a WPF app? wpf wpf

How can I open Windows Explorer to a certain directory from within a WPF app?


Why not Process.Start(@"c:\test");?


Process.Start("explorer.exe" , @"C:\Users");

I had to use this, the other way of just specifying the tgt dir would shut the explorer window when my application terminated.


This should work:

Process.Start(@"<directory goes here>")

Or if you'd like a method to run programs/open files and/or folders:

private void StartProcess(string path){    ProcessStartInfo StartInformation = new ProcessStartInfo();    StartInformation.FileName = path;    Process process = Process.Start(StartInformation);    process.EnableRaisingEvents = true;}

And then call the method and in the parenthesis put either the directory of the file and/or folder there or the name of the application. Hope this helped!