How to Windows 10 Disable or Prevent Update using a Script. Have you seen any of the following nag screens?
Here’s a script I’ve been using to prevent computers from upgrading to Windows 10. If the nag screens are present, it should uninstall the KB causing and finally reports the results of the script execution in the console.
Tested with MaxFocus RMM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
@echo off @break off @cls REM ----------------------------------- Overview ------------------------------------ REM Original script to prevent Windows 10 Upgrade pieced together by: Jonathan Warner REM Updated on: 20200131 REM Updated by: Computer Repair Sacramento REM Filename: wcs_prevent-win10-upgrade.bat REM distributed freely without any warranty or guarantee of suitability of fitness for any purpose! Use at your own risk! REM --------------------------------- Begin Code ------------------------------------ setlocal EnableDelayedExpansion IF EXIST C:\Windows\System32\GWX ( set "scriptnotes=GWX detected... " TASKKILL /IM GWX.exe /T /F TASKKILL /IM GWXUX.exe /T /F schtasks.exe /Change /TN "\Microsoft\Windows\Setup\gwx\launchtrayprocess" /Disable schtasks.exe /Change /TN "\Microsoft\Windows\Setup\gwx\refreshgwxconfig" /Disable rem uninstall KB3035583 start /wait wusa /uninstall /kb:3035583 /quiet /norestart /log start /wait wusa /uninstall /kb:3035583 /quiet /norestart /log if exist wusa.etl (del wusa.etl) if exist wusa.etl.dpx (del wusa.etl.dpx) rem delete folders present if exist C:\Windows\System32\GWX ( takeown /f C:\Windows\System32\GWX /r /d y icacls C:\Windows\System32\GWX /grant administrators:F /t rmdir /s /q C:\Windows\System32\GWX\ timeout 5 ) if exist "%localappdata%\GWX" ( takeown /f "%localappdata%\GWX" /r /d y icacls "%localappdata%\GWX" /grant administrators:F /t rmdir /s /q "%localappdata%\GWX\" timeout 5 ) if exist C:\$Windows~BT ( takeown /f C:\$Windows~BT /r /d y icacls C:\$Windows~BT /grant administrators:F /t rmdir /s /q C:\$Windows~BT\ timeout 5 ) if exist C:\Windows\SoftwareDistribution\Download ( takeown /f C:\Windows\SoftwareDistribution\Download /r /d y icacls C:\Windows\SoftwareDistribution\Download /grant administrators:F /t for /d %%i in (C:\Windows\SoftwareDistribution\Download\*) do rd /s /q "%%i" del /s /q C:\Windows\SoftwareDistribution\Download\*.* timeout 5 ) set "scriptnotes=!scriptnotes! Removed. " ) else ( set "scriptnotes=GWX not detected. " ) REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx" /v DisableGWX /d 1 /f>Nul REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v DisableOSUpgrade /d 1 /f>Nul REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" /v AllowOSUpgrade /d 0 /f>Nul REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" /v ReservationsAllowed /d 0 /f>Nul cls set "scriptnotes=!scriptnotes! Prevention applied." :END echo !scriptnotes! endlocal exit /b |
Have you tried this script to disable the windows 10 upgrade? I received some feedback. Unfortunately, syntax errors could occur and crash the script in the old version. I’ve reworked a couple of things and tested successfully. So, if you were having issues, just download the new version I uploaded a couple of minutes ago. Any thoughts on how preventing the Windows 10 upgrade has been going? – Jonathan
Hi Malvin, although it’s possible to script the steps to disable Windows 10 update, I’m sorry to say in my testing I was unable to find a way to reliably perform that with a script. When I touch a machine, I’ll move it to always show manually. Other than that, training seems the best policy.
Hi Melvin, nice to hear the feedback, thanks for your feedback on the script to disable Windows 10 update! Force system tray notifications? I’ve been wanting to do the same and had somewhat given up until your message. I’ll look into it and see if there’s any way to accomplish. Jonathan
Hi Jonathan, Thank you for this script.
Do you have any idea on how to force the RMM System Tray application to “Show Icon and Notifications”? Do you have a script for that? 🙂