陈晓猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery ("Select * from Win32_Service where Name = 'ShellHWDetection'")
For Each objService in colServiceList
If objService.State = "Running" Then
objService.StopService()
Wscript.Sleep 5000
End If
errReturnCode = objService.ChangeStartMode("Disabled")
Next

posted on 2017-02-17 08:59  陈晓猫  阅读(1366)  评论(0编辑  收藏  举报