Fix Windows Updates Problems and Issues Using Automatic Reset Script

Almost all Windows users are aware of the built-in “Windows Update” program or service which keeps Windows updated by downloading and installing latest updates, service packs, drivers and hotfixes released by Microsoft.

But sometimes users face various problems related to Windows Update such as not being able to download or install updates, getting random error messages/error codes, not being able to search for new updates, etc. Basically Windows updates won’t download or fail to install and you receive random error messages with error codes. These kind of issues can occur when Windows Update database or components are corrupted, one or more services related to Windows Update are not running, etc.

Windows_7_Checking_For_Updates_Problem.png

Advertisement

Today in this article, we are going to share a simple batch script which can help you in fixing various kind of problems and issues related to Windows Update. This script can be used in all Windows versions.

This batch script simply resets Windows Update components such as system folders (catroot2, SoftwareDistribution, etc) and services (Background Intelligent Transfer Service, Cryptographic Services and Windows Update or Automatic Updates Service) to troubleshoot the issue.

A big thanks to our reader “DTM” for sharing the commands which we have used in this batch script. He shared these commands in our following exclusive topic:

[Fix] “Your Windows 8.1 Install Couldn’t be Completed, Something Happened” Error Message

Although he shared the commands to fix Windows 8.1 update installation problem, but these commands will work in other Windows Update related issues as well.

If you are also facing any problem related to Windows Update in any Windows version, check out following simple steps to fix it:

STEP 1:

Advertisement

First of all you need to create the batch script. Open Notepad and paste following code in it:

@ECHO OFF
echo Simple Script to Reset / Clear Windows Update
echo.
PAUSE
echo.
attrib -h -r -s %windir%\system32\catroot2
attrib -h -r -s %windir%\system32\catroot2\*.*
net stop wuauserv
net stop CryptSvc
net stop BITS
ren %windir%\system32\catroot2 catroot2.old
ren %windir%\SoftwareDistribution sold.old
ren “%ALLUSERSPROFILE%\application data\Microsoft\Network\downloader” downloader.old
net Start BITS
net start CryptSvc
net start wuauserv
echo.
echo Task completed successfully…
echo.
PAUSE

Now save the file with the name “WUReset.bat” (including quotes).

Or you can download the ready-made batch script using following link:

Download Windows Update Reset Script

STEP 2:

Now run the batch script. Right-click on the .bat file and select “Run as Administrator” option. It’ll take a few seconds in executing the commands.

Reset_Windows_Update_Service.png

That’s it. Restart your computer and now you should be able to download and install all updates using Windows Update without any problem.

Also Check:

[Fix] Windows 7 Keeps Checking for Updates for Hours

[Fix] Windows 8/8.1 Keeps Checking for Updates Forever

[Tip] Use Windows Update Troubleshooter to Fix All Problems

Published in: Troubleshooting Guides, Windows 10, Windows 7, Windows 8, Windows Vista, Windows XP

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. After 1 yr. !! of this updating hassle, I have the pleasure of stumbling (‘googling’) on to this site. I feel oh-so Happy . VG,… are you Catholic?? If so, I’ll have my Catholic cousins nominate you for sainthood..! ( I would.. but..I’m Protestant.-sigh..) Thank you sooo much. Oxs

  2. Dear Author

    I tried this batch file on our Windows Server 2012 but no result.

    WSUS Services keep stopping and because of this our clients are not being updated automatically.

    Kindly help me in this matter as soon as possible and send me the solution on my email.

    I shall be very thankful to you.

    Regards

  3. Thank you so much for this solution. I have a relatively new laptop running Windows 10 and everything was working fine until a few days ago, when Windows Update just presented a blank window. I downloaded your batch file and ran it – and it fixed the problem immediately. I was a bit worried initially as restarting the PC and opening programs were extremely slow, but next time the speed was back to normal. And – most importantly – I have Windows Update working again! Thanks again.

  4. Thank you for the batch script. While most people who read your blog will know enough to right click -> run as administrator your batch script. There is a way to automatically invoke UAC at the cost of bloatifying the batch script.

    Below is a simple script I use to restart the print spooler on a win7 machine that frequently has spooler problems. (do note that the script would have to be tweaked if you needed it to work on Win8/10 machines)

    The script checks for privileges and if it doesnt have admin then it creates a vbscript in %temp% that executes a UAC call on the original script that created it. It then runs the commands below ::START

    Here is the code:

    :: Automatically check & get admin rights
    :::::::::::::::::::::::::::::::::::::::::
    @echo off
    CLS
    ECHO.
    ECHO =============================
    ECHO Running Admin shell
    ECHO =============================

    :checkPrivileges
    NET FILE 1>NUL 2>NUL
    if ‘%errorlevel%’ == ‘0’ ( goto gotPrivileges ) else ( goto getPrivileges )

    :getPrivileges
    if ‘%1’==’ELEV’ (shift & goto gotPrivileges)
    ECHO.
    ECHO **************************************
    ECHO Invoking UAC for Privilege Elevation
    ECHO **************************************

    setlocal DisableDelayedExpansion
    set “batchPath=%~0”
    setlocal EnableDelayedExpansion
    ECHO Set UAC = CreateObject^(“Shell.Application”^) > “%temp%\OEgetPrivileges.vbs”
    ECHO UAC.ShellExecute “!batchPath!”, “ELEV”, “”, “runas”, 1 >> “%temp%\OEgetPrivileges.vbs”
    “%temp%\OEgetPrivileges.vbs”
    exit /B

    :gotPrivileges
    ::::::::::::::::::::::::::::
    ::START
    ::::::::::::::::::::::::::::
    setlocal & pushd .

    REM Run shell as admin (example) – put here code as you like
    echo “Restarting Printing Service”
    net stop “Print Spooler”
    net start “Print Spooler”
    echo “Done Restarting Print Service. Please close this window”

  5. Thanks for the script. Ran, it did its thing then I rebooted. Started Windows Update again…and its taking a LONG time still. The only difference that I see is that the screen states that Windows has never checked for updates and never installed any updates. I presume that is because the directory has been renamed.
    So, my question is – how long should it take to find and update windows with the latest updates?

  6. Little bit of magic in a batchfile this. my mate was pulling his hair out spent 2 days trying to get the update to work on his win 7 after a re-install and this fixed it. I remembered this because it got me going a while back. Thanks very much, very helpful!

    Microsoft’s own ‘fixes’ are useless

  7. I used this script, ran as administrator and restarted as instructed, however it still searches for updates and nothing has changed. Please help D:

  8. I have reinstall my Vista 64 a few times now it came with the PC I have no problem to install Explorer 9, chrome ,essential system restore SFC/Scannow CHKDSK /r Did this script still having this hanging checking for update CPU run 29 % if I shut off windows update service CPU usage goes down to 0 Seem like the so call new windows update agent doesnt sit well and just sent it in the loop I can see the resource monitor working hard but no responce from the web site overnight I have had the catalog.update.microsoft.com/v7/site/Home.aspx to trust web site and still same thing overnight

  9. hi, i have tried all the steps that you mentioned but is still doing the same thing no update even when i download updates manual it takes hours & hours & nothing i end up switching off without it finishing.if theres anything else i can do your welcome to help.

  10. The batch file worked for me also, got 42 updates in a relatively short 2 hours, which is quick for this computer. I also saw that update said it had never been checked for updates or updated.
    Sadly I checked my bits service and it has stopped…..it has somehow been set to manual and I am unable to change it in properties as everything pertaining to that is greyed out.
    I think I need a command line to set it to automatic (delayed start), but I’m not sure how to do that.
    any help?

  11. Thank you guys so much!!! I cannot believe it. I could not get any updates for about a year on my Windows 7. I’ve tried so many things but the script was the only way I got the windows update to work. I am grateful.

  12. This script worked! I tried quite a few other solutions but this did the trick. Happily installing updates on another pc, a laptop as I write this.
    Thank you!

  13. I love the idea of a batch file fixing stuff. BUT, do you have a batch script to fix what Windows update ALWAYS deletes, like Chrome bookmarks, autofill info, keyboard setting, pinned doc/file addresses? I hate Windows update. Why does it reset stuff and not just update!

  14. I’ve done it and restarted the PC but when it booted up again it froze in the bootup animation๐Ÿ™๐Ÿผโ€โ™‚๏ธ

  15. I have tried this script in Windows Server 2016 and worked like a charm.

    WSUS showed servers that needed updates but when I checked from the server side it showed they were up-to-date. Then I ran the script, checked again and it started downloading and installing.

    Thank you !!!

  16. Hi Sir,

    How to configure Patch management for WinRAR?? which will automatically deploy as per scheduler in my network or Server to Client.

    please help…

  17. Thank you, worked like a charm on my Windows 8.1.
    I have a question. Is it okay to remove those folders “catroot2.old”, “sold.old” and “downloader.old” after the problem has been solved and all the updates have been installed?
    It seems like they won’t be needed any longer.

  18. Hi vg ,I would like to thank you in resolving this Windows Update Installation for my Windows 8.1 after checking and trying different methods to fix the Windows Update looking for ” Windows Update” during a KB Microsoft knowledge base search after downloading and running them from Microsoft…It goes on forever when I tried different methods as suggested by so many sites.
    But I came across your search hit tugged away from the “more” popular Windows, Superuser, and of course Microsoft in the order of the most searched sites. You deserve a honorable mention that I use your method of downloading a pre-created batch script followed by the correct installation package with the right OS edition. I basically clicked on TWO links and the 170 updates (Since 2014) started to download and install them. Thank you thank you thank you 2019 Nov 11

  19. When I run the script it says a duplicate file exists or the file cannot be found.
    The system cannot find the path specified.
    So how do I make this work?
    Thank You

  20. I have the exact problem that is described: After a fresh install, windows hangs when checking for updates. The batch-runs fine, but checking for updates still hangs.

    Another page linked to this page recommends also manually downloading two updates and installing them. But this fix does not work, because when I try to install the manually-dowloaded updates, the Windows Update Standalone Installer looks for updates on the computer, and hangs too.

  21. Hi VG ,i used your script but looks like things are not going according to plan on my pc.Im getting the following negative messages.

    Stopping Windows Update related services…
    ==========

    The Windows Update service is stopping.
    The Windows Update service could not be stopped.

    The Cryptographic Services service is stopping..
    The Cryptographic Services service could not be stopped.

    The Background Intelligent Transfer Service service is stopping..
    The Background Intelligent Transfer Service service was stopped successfully.

    Done!

    Renaming Windows Update related folders…
    ==========

    Access is denied.
    Access is denied.
    A duplicate file name exists, or the file
    cannot be found.
    Done!

    The rest of the commands are all successfull , thats why i paste here only the part with the “access is denied” messages

  22. My full cmd is the following

    ==========
    Simple Script to Reset / Clear Windows Update

    Created by “Vishal Gupta” for AskVG.com

    Thanks to DTM for sharing the commands
    ==========

    Press any key to continue . . .

    Stopping Windows Update related services…
    ==========

    The Windows Update service is stopping.
    The Windows Update service could not be stopped.

    The Cryptographic Services service is stopping..
    The Cryptographic Services service could not be stopped.

    The Background Intelligent Transfer Service service is stopping..
    The Background Intelligent Transfer Service service was stopped successfully.

    Done!

    Renaming Windows Update related folders…
    ==========

    Access is denied.
    Access is denied.
    A duplicate file name exists, or the file
    cannot be found.
    Done!

    Starting Windows Update related services…
    ==========

    The Background Intelligent Transfer Service service is starting.
    The Background Intelligent Transfer Service service was started successfully.

    The requested service has already been started.

    More help is available by typing NET HELPMSG 2182.

    The requested service has already been started.

    More help is available by typing NET HELPMSG 2182.

    Done!

    Task completed successfully…

    Press any key to continue . . .

  23. Omg, Ive been trying to get my laptop to update for a week and a half now, but every time it failed. I was trying every option I could find to fix it, and nothing worked. Then I found myself here, trying this option, and I am now happy because this method fixed my problems. Thank you ๐Ÿ™‚

  24. Windows 10 update ran and stopped with a blue screen at 30%. Now it simply loops as it reaches the blue screen at 30%. All the fixes seem to assume the user can still get into their computer to run these fixes. But I cannot stop the loop even if I do a cold start and try function keys to break into the loop. It has looped and rebooted at 30% many dozens of times now. It would seem that MS have wrecked my computer. This seems to be rather typical of their apparent disregard for the non-corporate user.
    It may be relevant, maybe not, but the compulsory update did get halted by a power failure, but surely MS don’t assume that all PCs can be guaranteed to run 100% through every update across every PC in the world? Or do they? But then MS can afford to have comprehensive and expensive power backup so that their test PCs cannot stop part way through an update. Sadly that is not the case for the ordinary user so the occasional power failure is always a possibility.

Leave a Comment

Your email address will not be published. Required fields are marked *

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.