Вопрос

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?

Это было полезно?

Решение

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")
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top