Process.Start (variable) to open an application without knowing the installation location

1

I have a Console Application that needs to call an application.

As I'm not sure where it was installed, I need to assign the value to the path variable as below to get the app install location.

string path = System.AppDomain.CurrentDomain.BaseDirectory + "IASD.ASCS.WPF.exe";

Now when I pass the parameter to open the application, Console Application does not open the application.

Processe.Start (path); 

No error message is displayed. Just do not load the executable.

How do I call this application when I do not know where the executable was installed?

    
asked by anonymous 10.04.2014 / 20:31

1 answer

1

If you want to launch the application from a specific location, then you need to know where it is.

I recommend that you do not put this location in your code, but rather that you use a configuration file. For example, use appSettings .

But if the application's location is in the environment variable PATH , then it's as simple as this:

Processe.Start("IASD.ASCS.WPF.exe");
    
11.04.2014 / 04:10