I want to know how i can check a program in a specific location if it is running. For example there are two locations for test.exe in c:loc1est.exe and c:loc2est.exe. I only wanted to know if c:loc1est.exe is running and not all instances of test.exe.
bool isRunning = Process.GetProcessesByName("test") .FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"c:loc1")) != default(Process);
2.1m questions
2.1m answers
60 comments
57.0k users