Identify a running process as a service

  • Thread starter Thread starter Christopher Attard
  • Start date Start date
C

Christopher Attard

Hi,

I'm getting a list of running processes on a machine using
Process.GetProcesses(). Can I identify programmatically which of these
processes is running as a service.

10x in advance.
Chris
 
Probably not, unless you enumerate the services on the machine and match the
executable startup paths.

Still, in XP/2003 there's a utility called "tasklist.exe" that displays this
information if you invoke it with the /scv switch so there must be a way.
Hmm.
 
Back
Top