├── PsExec.exe ├── README.md ├── disable updates.bat ├── enable updates.bat └── use update service.bat /PsExec.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsgrgo/windows-update-disabler/225b7368bece497822f6c1f4d082fa1fed7ed764/PsExec.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Windows Update Disabler 2 | 3 | ![](https://i.imgur.com/pGsWaOt.png 'Something went wrong') 4 | 5 | ⚡ The one-click way to disable auto updates for good, without leaving leftover stuff running in the background. 6 | 7 | > [!WARNING] 8 | > Before running this script, ensure that Windows is fully updated and not currently installing or downloading updates! Interrupting an update could result in breaking your Windows installation! 9 | 10 | ## How to Use 11 | 12 | ### Simple! 13 | 14 | 1. **Clone or Download:** 15 | 16 | - Clone this repository using `git clone https://github.com/tsgrgo/windows-update-disabler.git` or download it as a ZIP file and extract it. 17 | 18 | 2. **Check for Active Updates:** 19 | 20 | - Ensure there are no updates currently being installed. Navigate to **Settings > Update & Security > Windows Update** and verify. 21 | 22 | 3. **Run the Script:** 23 | 24 | - Execute `disable updates.bat`. This will disable automatic Windows updates. 25 | 26 | 4. **Re-enable Updates (Optional):** 27 | - If you need to allow automatic updates again, run `enable updates.bat`. This is a complete inverse function of `disable updates.bat` and will undo all the changes it did. 28 | 29 | ## How to Update Manually 30 | 31 | Regular updates are recommended for security. To update manually: 32 | 33 | 1. **Enable Updates:** 34 | 35 | - Run `enable updates.bat` to re-enable Windows Update. 36 | 37 | 2. **Perform Updates:** 38 | 39 | - Navigate to **Settings > Update & Security > Windows Update** and install available updates. 40 | 41 | 3. **Disable Updates Again:** 42 | - After updating, run `disable updates.bat` again to disable automatic updates. 43 | 44 | ## Using the Update Service Temporarily 45 | 46 | Some applications, like Microsoft Store, depend on the Windows Update service. To temporarily enable the service: 47 | 48 | 1. **Enable Update Service:** 49 | 50 | - Run `use update service.bat` to re-enable the Windows Update Service. 51 | 52 | 2. **Use Dependent Applications:** 53 | 54 | - You can now use applications that require the update service. 55 | 56 | 3. **Disable Update Service Again:** 57 | - Once done, run `disable updates.bat` to disable the update service again. 58 | 59 | ## What It Does 60 | 61 | The script performs the following actions to disable automatic updates: 62 | 63 | - Disables the **Windows Update Service (wuauserv)**. 64 | - Disables the **Update Orchestrator Service (UsoSvc)**. 65 | - Disables the **Windows Update Medic Service (WaaSMedicSvc)**. 66 | - Disables all update-related scheduled tasks. 67 | - Applies registry changes to prevent auto-updates. 68 | 69 | ## Why is PsExec Needed? 70 | 71 | Some of the services and tasks involved are protected from user accounts, and they require elevated system privileges to be modified. PsExec allows the script to run commands with the necessary permissions to bypass these restrictions. 72 | 73 | PsExec is part of the official Sysinternals suite from Microsoft. More info: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec 74 | -------------------------------------------------------------------------------- /disable updates.bat: -------------------------------------------------------------------------------- 1 | :: Author: tsgrgo 2 | :: Completely disable Windows Update 3 | :: PsExec is required to get system privileges - it should be in this directory 4 | 5 | if not "%1"=="admin" (powershell start -verb runas '%0' admin & exit /b) 6 | if not "%2"=="system" (powershell . '%~dp0\PsExec.exe' /accepteula -i -s -d '%0' admin system & exit /b) 7 | 8 | :: Disable update related services 9 | for %%i in (wuauserv, UsoSvc, uhssvc, WaaSMedicSvc) do ( 10 | net stop %%i 11 | sc config %%i start= disabled 12 | sc failure %%i reset= 0 actions= "" 13 | ) 14 | 15 | :: Brute force rename services 16 | for %%i in (WaaSMedicSvc, wuaueng) do ( 17 | takeown /f C:\Windows\System32\%%i.dll && icacls C:\Windows\System32\%%i.dll /grant *S-1-1-0:F 18 | rename C:\Windows\System32\%%i.dll %%i_BAK.dll 19 | icacls C:\Windows\System32\%%i_BAK.dll /setowner "NT SERVICE\TrustedInstaller" && icacls C:\Windows\System32\%%i_BAK.dll /remove *S-1-1-0 20 | ) 21 | 22 | :: Update registry 23 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 4 /f 24 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v FailureActions /t REG_BINARY /d 000000000000000000000000030000001400000000000000c0d4010000000000e09304000000000000000000 /f 25 | reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f 26 | 27 | :: Delete downloaded update files 28 | erase /f /s /q c:\windows\softwaredistribution\*.* && rmdir /s /q c:\windows\softwaredistribution 29 | 30 | :: Disable all update related scheduled tasks 31 | powershell -command "Get-ScheduledTask -TaskPath '\Microsoft\Windows\InstallService\*' | Disable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\UpdateOrchestrator\*' | Disable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\UpdateAssistant\*' | Disable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\WaaSMedic\*' | Disable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\WindowsUpdate\*' | Disable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\WindowsUpdate\*' | Disable-ScheduledTask" 32 | 33 | echo Finished 34 | pause -------------------------------------------------------------------------------- /enable updates.bat: -------------------------------------------------------------------------------- 1 | :: Author: tsgrgo 2 | :: Re-enable Windows auto updates and undo all changes by 'disable updates.bat' 3 | :: PsExec is required to get system privileges - it should be in this directory 4 | 5 | if not "%1"=="admin" (powershell start -verb runas '%0' admin & exit /b) 6 | if not "%2"=="system" (powershell . '%~dp0\PsExec.exe' /accepteula -i -s -d '%0' admin system & exit /b) 7 | 8 | :: Enable update related services 9 | sc config wuauserv start= auto 10 | sc config UsoSvc start= auto 11 | sc config uhssvc start= delayed-auto 12 | 13 | :: Restore renamed services 14 | for %%i in (WaaSMedicSvc, wuaueng) do ( 15 | takeown /f C:\Windows\System32\%%i_BAK.dll && icacls C:\Windows\System32\%%i_BAK.dll /grant *S-1-1-0:F 16 | rename C:\Windows\System32\%%i_BAK.dll %%i.dll 17 | icacls C:\Windows\System32\%%i.dll /setowner "NT SERVICE\TrustedInstaller" && icacls C:\Windows\System32\%%i.dll /remove *S-1-1-0 18 | ) 19 | 20 | :: Update registry 21 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 3 /f 22 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v FailureActions /t REG_BINARY /d 840300000000000000000000030000001400000001000000c0d4010001000000e09304000000000000000000 /f 23 | reg delete "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /f 24 | 25 | :: Enable all update related scheduled tasks 26 | powershell -command "Get-ScheduledTask -TaskPath '\Microsoft\Windows\InstallService\*' | Enable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\UpdateOrchestrator\*' | Enable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\UpdateAssistant\*' | Enable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\WaaSMedic\*' | Enable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\Windows\WindowsUpdate\*' | Enable-ScheduledTask; Get-ScheduledTask -TaskPath '\Microsoft\WindowsUpdate\*' | Enable-ScheduledTask" 27 | 28 | echo Finished 29 | pause 30 | -------------------------------------------------------------------------------- /use update service.bat: -------------------------------------------------------------------------------- 1 | :: Author: tsgrgo 2 | :: PsExec is required to get system privileges - it should be in this directory 3 | 4 | @echo off 5 | if not "%1"=="admin" (powershell start -verb runas '%0' admin & exit /b) 6 | if not "%2"=="system" (powershell . '%~dp0\PsExec.exe' /accepteula -i -s -d '%0' admin system & exit /b) 7 | 8 | :: Restore renamed services 9 | for %%i in (wuaueng) do ( 10 | takeown /f C:\Windows\System32\%%i_BAK.dll && icacls C:\Windows\System32\%%i_BAK.dll /grant *S-1-1-0:F 11 | rename C:\Windows\System32\%%i_BAK.dll %%i.dll 12 | icacls C:\Windows\System32\%%i.dll /setowner "NT SERVICE\TrustedInstaller" && icacls C:\Windows\System32\%%i.dll /remove *S-1-1-0 13 | ) 14 | 15 | :: Change service config 16 | sc config wuauserv start= auto 17 | 18 | echo. 19 | echo Enabled Windows Update Service 20 | echo You can now use software that relies on the Windows Update Service. 21 | echo When finished, you can run the disabler again. 22 | echo More info in README 23 | echo. 24 | pause 25 | --------------------------------------------------------------------------------