Created
May 9, 2017 14:09
-
-
Save oflow/57f3556b5f2698e783c2f548a1314276 to your computer and use it in GitHub Desktop.
俺のタイミングで更新させろ!それ以外は何もするな!何もするな!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim wsh, svList, svInfo | |
Dim scPath, query, scMode | |
scPath = "%WINDIR%\System32\sc.exe" | |
query = "SELECT * FROM Win32_Service WHERE Name='wuauserv'" | |
Set svList = GetObject("winmgmts:").ExecQuery(query) | |
For Each svInfo In svList | |
scMode = svInfo.StartMode | |
Next | |
Set wsh = WScript.CreateObject("WScript.Shell") | |
wsh.Run scPath & " stop wuauserv", 0 | |
wsh.Run scPath & " stop UsoSvc", 0 | |
If scMode <> "Disabled" Then | |
wsh.Run scPath & " config wuauserv start=disabled", 0 | |
wsh.Run scPath & " config UsoSvc start=disabled", 0 | |
Else | |
wsh.Run scPath & " config wuauserv start=demand", 0 | |
wsh.Run scPath & " config UsoSvc start=demand", 0 | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment