Windows服务可执行文件的路径

如何从其他程序获取特定Windows服务的可执行文件的路径? 不幸的是,ServiceController类(System.ServiceProcess)没有为它提供方法或属性!

您可以使用HKLM中的注册表从这里获取它们:

  System\CurrentControlSet\Services\Service 

查找ImagePath值。