Find a running executable

  • Thread starter Thread starter Roy
  • Start date Start date
R

Roy

Is there a way to find out if an executable (with known full path of the exe
file) is running or not in C#?
 
Hi Roy,

If you know the process name you can use the System.Diagnostics.Process
class to find it.

If you don't know the process name, you can still use the Process class, but
you need to use Process.GetProcesses and loop through each
Process.MainModule.FileName to find the one matching the executable.
 
Back
Top