Pergunta

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?

Foi útil?

Solução

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")
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top