I'm trying to run an exe using ProcessStartInfo. The problem is I only want to specify the exe name, and add the executable path to the PATH environment variable in Windows. When I try to run my application I got a FileNotFoundException. Everything works fine when I start the process with the full name. Any ideas?
-- Edit: Thanks for the comments, Ill give an example to make it more clear:
ProcessStartInfo p = new ProcessStartInfo("example.exe");
I added the path of example.exe in the Windows Envirionment PATH variable manually, but still my application can't start the process example.exe
You could create a sub key in the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths in the registry.
Have a look at Registering Applications Using the App Paths sub key.