How do I obtain the executable path of a specific Windows service from another program? Unfortunately class service controller (system. Service process) does not provide any method or property for it!
There is always the WMI class in the pathname
as described above Win32_Service
.
This works:
ManagementClass mc = new ManagementClass ("Win32_Service"); Foreach (McGutt Instance) (Management object Mo () (if (M.Getproperty Value ("name"). ToString () == "& lt; short for your service";) {fat.Guide property value ("pathname ") .Toasting (.) Trim ('' ');}}
Comments
Post a Comment