I’m trying to create a C# program to launch other external applications. I googled around and found this: http://www.dotnetperls.com/process-start which I think is a pretty good tutorial. The only problem I have is I don’t always know the path for the programs.
For instance, if I do this:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "firefox.exe";
Process.Start(startInfo);
It launches firefox successfully. However if I do this:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "chrome.exe";
Process.Start(startInfo);
It fails because it can’t find chrome and it looks like I need to launch it from its exact path. So my question is is there a way to access a universal registry of all installed applications and launch from there? Thanks.
Applications can be directly launched when their folder path is in ‘PATH’ environment variable.
This variable can be viewed and edited in:
Entries are separated by
;.I think you can lauch Firefox because Firefox already put its folder into PATH.