Monday, April 25, 2011

How can I check if a windows service is installed using path of executable?

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?

From stackoverflow
  • Two options.

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

    2. Iterate through the registry

    DeeStackOverflow : Too cumbersome. Thanks anyways.

0 comments:

Post a Comment