Question

I Wrote this code to Open an .exe file in %appdata% in console:

try {
    System.Diagnostics.Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData  ));
}
catch { }

It opens appdata Directory but I want it to open an .exe file. What should I do?

Était-ce utile?

La solution

You need to combine the exe name with the folder name before calling the program

System.Diagnostics.Process.Start( System.IO.Path.Combine(  Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData  ), "Exename.exe")
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top