描述
返回在 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