WMI call takes too much time when system Starts/ReStarts

后端 未结 3 1681
醉梦人生
醉梦人生 2021-01-22 16:44

I want to get the path of the Windows Service,

var managementObjectSearcher = new ManagementObjectSearcher(\"Select * from Win32_Service where serviceName = MySe         


        
3条回答
  •  情话喂你
    2021-01-22 17:24

    If it is the "latency" of WMI that is bothering you, you don't have to use WMI to get a service's path, ie. executable name. You can also P/invoke QueryServiceConfig.

    http://www.pinvoke.net/default.aspx/advapi32/queryserviceconfig.html

提交回复
热议问题