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