确定在某个进程中运行的服务

 
描述
返回在 Services.exe 进程中运行的服务的列表。

脚本代码
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{ impersonationLevel=impersonate }!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colListOfServices
If objService.PathName = "C:\WINDOWS\system32\services.exe" Then
Wscript.Echo objService.DisplayName
End If
Next

你可能感兴趣的:(职场,进程,休闲)