Imthedude025

Disable Windows Updates Via Batch (Batch)

Jan 16th, 2022 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.61 KB | None | 0 0
  1. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  2. ::Cap Bill Gates From Infecting You With His Bullsh!t. ::
  3. ::AKA - Disable Windows Updates Via Batch ::
  4. ::Coded by RU$$ [https://steamcommunity.com/id/CrypticNight7/] ::
  5. ::Credits to Seba Computer Training Center ::
  6. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. @ECHO OFF
  8.  
  9. Rem | Tweak Service Windows Update | Reset Fail, Startup Type, And Stop
  10. echo Tweaking Service "Windows Update":
  11. SC failure wuauserv reset= 0 actions= restart/0/none/0/none/0
  12. sc config wuauserv start= disabled
  13. echo(
  14.  
  15. Rem | Tweak Service Background Intelligent Transfer Service | Reset Fail, Startup Type, And Stop
  16. echo Tweaking Service "Background Intelligent Transfer Service":
  17. SC failure BITS reset= 0 actions= restart/0/none/0/none/0
  18. sc config BITS start= disabled
  19. echo(
  20.  
  21. Rem | Disable Task Scheduled Start
  22. echo Disabling Task "WindowsUpdate\Scheduled Start":
  23. schtasks.exe /change /tn "Microsoft\Windows\WindowsUpdate\Scheduled Start" /disable
  24. echo(
  25.  
  26. Rem | Create Registry Items
  27. echo Created Registry Items:
  28. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate" >nul 2>&1
  29. if %errorlevel% equ 0 (
  30. echo - Removed Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate"
  31. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate" /f >nul 2>&1
  32. )
  33. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate" >nul 2>&1
  34. if %errorlevel% equ 1 (
  35. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate"
  36. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate" >nul 2>&1
  37. )
  38. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" >nul 2>&1
  39. if %errorlevel% equ 1 (
  40. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU"
  41. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" >nul 2>&1
  42. )
  43. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" -v AUOptions >nul 2>&1
  44. if %errorlevel% equ 1 (
  45. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU\AUOptions" Value 2
  46. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 2 /f >nul 2>&1
  47. )
  48. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" -v AUOptions >nul 2>&1
  49. if %errorlevel% equ 0 (
  50. echo - Removed Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU\AUOptions"
  51. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" /v AUOptions /f >nul 2>&1
  52. )
  53. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" -v NoAutoUpdate >nul 2>&1
  54. if %errorlevel% equ 1 (
  55. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU\NoAutoUpdate" Value 2
  56. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 2 /f >nul 2>&1
  57. )
  58. echo(
  59.  
  60. Rem | Create Local Group Policies
  61. echo Disabling "Allow Downloads From Other PCs" Local Group Policy
  62. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" >nul 2>&1
  63. if %errorlevel% equ 1 (
  64. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization"
  65. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" >nul 2>&1
  66. )
  67. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" -v DODownloadMode >nul 2>&1
  68. if %errorlevel% equ 0 (
  69. echo - Removed Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization\DODownloadMode"
  70. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v DODownloadMode /f >nul 2>&1
  71. )
  72. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" -v DODownloadMode >nul 2>&1
  73. if %errorlevel% equ 1 (
  74. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization\DODownloadMode" Value 0
  75. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v DODownloadMode /t REG_DWORD /d 0 /f >nul 2>&1
  76. )
  77. echo Disabling "Configure Automatic Updates" Local Group Policy
  78. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAutoUpdate >nul 2>&1
  79. if %errorlevel% equ 0 (
  80. echo - Removed Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate"
  81. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /f >nul 2>&1
  82. )
  83. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v AUOptions >nul 2>&1
  84. if %errorlevel% equ 1 (
  85. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate" Value 1
  86. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f >nul 2>&1
  87. )
  88. echo Created Registry Items:
  89. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" >nul 2>&1
  90. if %errorlevel% equ 0 (
  91. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
  92. reg delete "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f >nul 2>&1
  93. )
  94. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" >nul 2>&1
  95. if %errorlevel% equ 1 (
  96. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
  97. reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" >nul 2>&1
  98. )
  99. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" >nul 2>&1
  100. if %errorlevel% equ 1 (
  101. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
  102. reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" >nul 2>&1
  103. )
  104. reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" >nul 2>&1
  105. if %errorlevel% equ 0 (
  106. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate"
  107. reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /f >nul 2>&1
  108. )
  109. reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" >nul 2>&1
  110. if %errorlevel% equ 1 (
  111. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate"
  112. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" >nul 2>&1
  113. )
  114. echo Disabling "Show a notifaction when your PC requires an update" Windows Update Setting
  115. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -v SetAutoRestartNotificationDisable >nul 2>&1
  116. if %errorlevel% equ 1 (
  117. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\SetAutoRestartNotificationDisable" Value 1
  118. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v SetAutoRestartNotificationDisable /t REG_DWORD /d 1 /f >nul 2>&1
  119. )
  120. echo Disabling "automatically download updates over metered connections" Windows Update Setting
  121. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -v AllowAutoWindowsUpdateDownloadOverMeteredNetwork >nul 2>&1
  122. if %errorlevel% equ 0 (
  123. echo - Removed Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings\AllowAutoWindowsUpdateDownloadOverMeteredNetwork"
  124. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v AllowAutoWindowsUpdateDownloadOverMeteredNetwork /f >nul 2>&1
  125. )
  126. reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -v AllowAutoWindowsUpdateDownloadOverMeteredNetwork >nul 2>&1
  127. if %errorlevel% equ 1 (
  128. echo - Created Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings\AllowAutoWindowsUpdateDownloadOverMeteredNetwork" Value 0
  129. reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v AllowAutoWindowsUpdateDownloadOverMeteredNetwork /t REG_DWORD /d 0 /f >nul 2>&1
  130. )
  131. echo Disabling "Show a notifaction when your PC requires an update #2" Windows Update Setting
  132. reg query "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" -v SetAutoRestartRequiredNotificationDismissal >nul 2>&1
  133. if %errorlevel% equ 0 (
  134. echo - Removed Key "Software\Policies\Microsoft\Windows\WindowsUpdate\SetAutoRestartRequiredNotificationDismissal"
  135. reg delete "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" /v SetAutoRestartRequiredNotificationDismissal /f >nul 2>&1
  136. )
  137. reg query "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" -v SetAutoRestartRequiredNotificationDismissal >nul 2>&1
  138. if %errorlevel% equ 1 (
  139. echo - Created Key "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\SetAutoRestartRequiredNotificationDismissal" Value 0
  140. reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate" /v SetAutoRestartRequiredNotificationDismissal /t REG_DWORD /d 0 /f >nul 2>&1
  141. )
  142. echo Disabling "...adjust defualt option to 'install updates and shut down'..." Local Group Policy
  143. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAUAsDefaultShutdownOption >nul 2>&1
  144. if %errorlevel% equ 0 (
  145. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUAsDefaultShutdownOption"
  146. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAUAsDefaultShutdownOption /f >nul 2>&1
  147. )
  148. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAUAsDefaultShutdownOption >nul 2>&1
  149. if %errorlevel% equ 1 (
  150. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUAsDefaultShutdownOption" Value 1
  151. reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAUAsDefaultShutdownOption /t REG_DWORD /d 1 /f >nul 2>&1
  152. )
  153. echo Disabling "...adjust defualt option to 'install updates and shut down'..." Local Group Policy
  154. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAutoRebootWithLoggedOnUsers >nul 2>&1
  155. if %errorlevel% equ 0 (
  156. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers"
  157. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /f >nul 2>&1
  158. )
  159. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAutoRebootWithLoggedOnUsers >nul 2>&1
  160. if %errorlevel% equ 1 (
  161. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers" Value 1
  162. reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 1 /f >nul 2>&1
  163. )
  164. echo Disabling "...do not display 'install updates and shut down'..." Local Group Policy
  165. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAUShutdownOption >nul 2>&1
  166. if %errorlevel% equ 0 (
  167. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUShutdownOption"
  168. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAUShutdownOption /f >nul 2>&1
  169. )
  170. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAUShutdownOption >nul 2>&1
  171. if %errorlevel% equ 1 (
  172. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUShutdownOption" Value 0
  173. reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAUShutdownOption /t REG_DWORD /d 0 /f >nul 2>&1
  174. )
  175. echo Disabling "...adjust defualt option to 'install updates and shut down'..." Local Group Policy
  176. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAUAsDefaultShutdownOption >nul 2>&1
  177. if %errorlevel% equ 0 (
  178. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUAsDefaultShutdownOption"
  179. reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAUAsDefaultShutdownOption /f >nul 2>&1
  180. )
  181. reg query "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -v NoAUAsDefaultShutdownOption >nul 2>&1
  182. if %errorlevel% equ 1 (
  183. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAUAsDefaultShutdownOption" Value 0
  184. reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAUAsDefaultShutdownOption /t REG_DWORD /d 0 /f >nul 2>&1
  185. )
  186. echo Disabling "Remove access to use all windows features" Local Group Policy
  187. reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" -v DisableWindowsUpdateAccess >nul 2>&1
  188. if %errorlevel% equ 0 (
  189. echo - Removed Key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate\DisableWindowsUpdateAccess"
  190. reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /v DisableWindowsUpdateAccess /f >nul 2>&1
  191. )
  192. reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" -v DisableWindowsUpdateAccess >nul 2>&1
  193. if %errorlevel% equ 1 (
  194. echo - Created Key "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate\DisableWindowsUpdateAccess" Value 0
  195. reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /v DisableWindowsUpdateAccess /t REG_DWORD /d 0 /f >nul 2>&1
  196. )
  197. echo(
  198.  
  199. Rem | Grab All Profiles And Set To Metered
  200. echo Changing All Connections To Metered:
  201. for /f "tokens=4,* skip=4" %%a in ('netsh wlan show profile') do (
  202. Rem | Set Current Profile To Metered
  203. echo Profile "%%b" Has Been Set To Metered
  204. netsh wlan set profileparameter name="%%b" cost=Fixed >nul 2>&1
  205. )
  206. echo(
  207.  
  208. Rem | Delete Folder "C:\$WINDOWS.~BT"
  209. echo Removing "C:\$WINDOWS.~BT":
  210. IF EXIST "C:\$WINDOWS.~BT" (
  211. rmdir "C:\$WINDOWS.~BT"
  212. echo - "C:\$WINDOWS.~BT" was deleted.
  213. ) ELSE (
  214. echo - "C:\$WINDOWS.~BT" already deleted.
  215. )
  216. echo(
  217.  
  218. Rem | Configurations Completed
  219. echo All Configurations Have Completed. Please Restart Your PC.
  220. echo(
  221.  
  222. pause
Add Comment
Please, Sign In to add comment