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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top