C#C
C#3y ago
Nemesis

❔ Process.Start doesn't open directory

I am looking for a generalized way of opening directories through C# application.
Most of the stackoverflow answers, such as this: https://stackoverflow.com/questions/1746079/how-can-i-open-windows-explorer-to-a-certain-directory-from-within-a-wpf-app/30939461#30939461, say Process.Start(<directory>) should work.
But I get exception:
System.ComponentModel.Win32Exception: 'An error occurred trying to start process 'file:///C:/dev/directory' with working directory '<workingdirectory>'. The system cannot find the file specified.'
I am able to open the directory by Process.Start("explorer", "C:/dev/directory"). So, why is the other way not working?
Is the answer for an older version of C# or am I doing something wrong?
Stack Overflow
In a WPF application, when a user clicks on a button I want to open the Windows explorer to a certain directory, how do I do that?

I would expect something like this:

Windows.OpenExplorer("c:\tes...
Was this page helpful?