views:

891

answers:

1

How can I check if a windows service is installed using just the executable path?
I checked the ServiceController class - it lets you use service name and display name but not the executable name to verify.

I only have the executable's FullName available for use in my code. Any ideas?

+2  A: 

Two options.

  1. WMI. The Win32_Service class's PathName property has the executable command line (so includes parameters).

  2. Iterate through the registry

Richard
Too cumbersome. Thanks anyways.
DeeStackOverflow