Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :loop
- sc query wuauserv | find "RUNNING"
- if %errorlevel%==0 (
- echo Service Windows Update is running, try to stop it...
- sc.exe config wuauserv start=disabled
- net stop wuauserv
- ) else (
- echo Service Windows Update is not running
- )
- timeout /t 5 /nobreak
- goto loop
Advertisement
Comments
-
Comment was deleted
-
- PowerShell command to create a task to run the script automatically after startup
- --------------
- Register-ScheduledTask -TaskName "WUStopperTask" -Action (New-ScheduledTaskAction -Execute "c:\WindowsUpdateBlocker.bat") -Trigger (New-ScheduledTaskTrigger -AtStartup) -Principal (New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest) -Settings (New-ScheduledTaskSettingsSet -ExecutionTimeLimit 0 -AllowStartIfOnBatteries)
Add Comment
Please, Sign In to add comment