Dim strComputer
Dim objWMIService
Dim colListOfServices
Dim objService
Dim oReg
Dim strKeyPath
Dim strValueName
Dim dwValue
strComputer = "."
'禁用服务-------------------------
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name = 'srservice'")
For Each objService in colListOfServices
objService.Change , , , , "Disabled"
Next