How can I get the path to the executable of a specific windows service from another program ? Unfortunately the class ServiceController (System.ServiceProcess) doesn't provide a method or property for that !
The physical path is 'C:\WINDOWS\TEMP\. net\FreshIQAppMessagingService\zu4jbgzc. let AppDomain.
To change the executable path of ServiceDesk go to below-mentioned location from registry. run -> regedit -> navigate to the below-mentioned location and highlight the ServiceDesk and from the right-hand side edit the ImagePath as required.
The Windows System PATH tells your PC where it can find specific directories that contain executable files. ipconfig.exe , for example, is found in the C:\Windows\System32 directory, which is a part of the system PATH by default.
servicePath is a configure, price and quote (CPQ) platform that is specifically designed to make complex quotes simple. Quotes that used to take days and involve multiple departments can be done in less than an hour in servicePath.
There's always the WMI class Win32_Service
as described here, specifically the PathName
.
This works:
ManagementClass mc = new ManagementClass("Win32_Service");
foreach(ManagementObject mo in mc.GetInstances())
{
if(mo.GetPropertyValue("Name").ToString() == "<Short name of your service>")
{
return mo.GetPropertyValue("PathName").ToString().Trim('"');
}
}
You can obtain them from here using the Registry in HKLM:
System\CurrentControlSet\Services\Service
Look for the ImagePath value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With