View Full Version : C#: Make sure a process is running by its Directory.

07-03-2009, 11:07 PM
Hello, my program starts 2 programs.. From different directorys, but they both need to stay running ALL the time, so if one crashes I need my program to be able to start it up again, but the problem is that they are both the same program and come up in the process manager as the same thing.. But they actually do two different things.

Edit: Oh yeah, and this is in C#

So I need to be able to start the seperate ones ;)

Thanks and please help :d

07-06-2009, 03:44 PM
Try this:

Process[] procs;
procs = Process.GetProcessesByName("OUTLOOK"); // put your process name here
foreach (Process p in procs)
MessageBox.Show(p.MainModule.FileName); // for example...
Also, check out all the info you get with the Process class:

Good luck;