Last active
September 29, 2022 16:31
-
-
Save germ13/a1fe9bfc4640654fc47905ec2e0bacfd to your computer and use it in GitHub Desktop.
Fix Stuck Windows Updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF echo This script is intended to stop fix broken windows updates | |
REM Changing folder and file permissions for locked files | |
attrib -h -r -s %windir%\system32\catroot2 | |
attrib -h -r -s %windir%\system32\catroot2\*.* | |
REM Stopping services that lock relevant files | |
net stop wuauserv | |
net stop CryptSvc | |
net stop BITS | |
REM Creating backups of folders | |
ren %windir%\system32\catroot2 catroot2.old | |
ren %windir%\SoftwareDistribution SoftwareDistribution.old | |
ren "%ALLUSERSPROFILE%\application data\MicrosoftNetwork\downloader" downloader.old | |
REM Restarting services | |
net Start BITS | |
net start CryptSvc | |
net start wuauserv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello Memo. Hope this works. Its attempting to clear out the files that are locked and preventing the update.
CMD
and then right click on "command prompt" and select "Run as Admistrator"