Reputation: 2781
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?
Upvotes: 1
Views: 1607
Reputation: 109180
Two options.
WMI. The Win32_Service class's PathName property has the executable command line (so includes parameters).
Iterate through the registry
Upvotes: 2