Advertisement
severen1999

AutoItWin10UpdateScript

Oct 31st, 2020 (edited)
4,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.57 KB | None | 0 0
  1. #cs
  2. You can type commands below in a dos prompt w/ AdminRights to force the shutdown of windows update related services.
  3.  
  4. net stop bits
  5. net stop wlidsvc
  6. net stop TokenBroker
  7. net stop UsoSvc
  8. net stop wuauserv
  9. net stop TrustedInstaller
  10. #CE
  11.  
  12. ;lines that begin with ; are commented lines.  They do nothing in the actual script.
  13. ;lines that have a ; at some point after the beginning comments out everything after ;
  14.  
  15. ;Beginning Of Script to run in AUTOit that runs in the background and automatically shuts/disables the services if they ever
  16. auto reactivate themselves.
  17.  
  18. While 1 = 1 ;Start and do everything in While -> Wend loop indefinitely
  19.     if @hour = 14 Then ;At 2pm do the below line.  This time is in Military Time Format and can be set to your needs.
  20.         Exit ;close and terminate script
  21.     EndIf
  22.     Run(@ComSpec & " /k net stop bits", "", @SW_HIDE)
  23.     Sleep(3000)
  24.     ProcessClose("cmd.exe")
  25.     Run(@ComSpec & " /k net stop wlidsvc", "", @SW_HIDE)
  26.     Sleep(3000)
  27.     ProcessClose("cmd.exe")
  28.     Run(@ComSpec & " /k net stop TokenBroker", "", @SW_HIDE)
  29.     Sleep(3000)
  30.     ProcessClose("cmd.exe")
  31.     Run(@ComSpec & " /k net stop UsoSvc", "", @SW_HIDE)
  32.     Sleep(3000)
  33.     ProcessClose("cmd.exe")
  34.     Run(@ComSpec & " /k net stop wuauserv", "", @SW_HIDE)
  35.     Sleep(3000)
  36.     ProcessClose("cmd.exe")
  37.     Run(@ComSpec & " /k net stop TrustedInstaller", "", @SW_HIDE)
  38.     Sleep(3000)
  39.     ProcessClose("cmd.exe")
  40.     Run(@ComSpec & " /k net stop TrustedInstaller", "", @SW_HIDE)
  41.     Sleep(3000)
  42.     ProcessClose("cmd.exe")
  43.     Sleep(10000) ;Sleep Script for 10 minutes until rechecking services
  44. WEnd ; Exit the main loop
  45.  
  46. Exit
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement