描述
傳回在 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
本文轉自 蘇繁 51CTO部落格,原文連結:http://blog.51cto.com/goxia/221131,如需轉載請自行聯系原作者