josefkyrian

WindowsUpdateBlocker.bat

Mar 14th, 2024 (edited)
81
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | Cybersecurity | 0 0
  1. @echo off
  2. :loop
  3. sc query wuauserv | find "RUNNING"
  4. if %errorlevel%==0 (
  5. echo Service Windows Update is running, try to stop it...
  6. sc.exe config wuauserv start=disabled
  7. net stop wuauserv
  8. ) else (
  9. echo Service Windows Update is not running
  10. )
  11. timeout /t 5 /nobreak
  12. goto loop
Advertisement
Comments
  • josefkyrian
    1 year
    1
    Comment was deleted
  • josefkyrian
    1 year
    # text 0.45 KB | 0 0
    1. PowerShell command to create a task to run the script automatically after startup
    2. --------------
    3. 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