Fix Windows Update Problems 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, not being able to search for new updates, etc. 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.

Today in this article, we are going to share a simple batch script which can help you in fixing various kind of 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:

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





Share this article: Facebook | Twitter | Google+ | Reddit | Tell a friend

Posted in: Troubleshooting, Windows 10, Windows 7, Windows 8 / 8.1, Windows Vista, Windows XP


Other similar articles that may interest you


Comments

  • Hi VG,

    This is a nice tool to have around.

    Question though: You stated "This script can be used in all Windows versions including..." then went on to only cite "...Windows 7, Windows 8, Windows 8.1 and Windows 10." So does it work on Windows XP and Windows Vista as well?

    Thanks

  • VG

    ^^ You an use the script in Windows XP and Vista too.

  • Awesome. I was not able to download any update in Windows 7 home premium. Your script fixed my problem. Thank you so much.

  • It was very useful VG!

  • Computer would spend 5 minutes trying to install a service pack update and would continually fail until we ran this patch. Rebooted and all is good. Thank you!

  • I am playing around on my Dell Latitude XT2, running getintopc.com's WXPBE on a 16GB microsata SSD, and cannot get the touchscreen Driver to succeed in installation, plus there are 7 updates that always fail to install... I don't think I will need to use WUReset.bat but I have the script just in case. I know the TOUCHSCREEN Works bcoz I also have installed Android 4.2.test in Dual boot mode and discovered entirely by accident that yes I do have touchscreen ability. I am however also frustrated by the display not working with any version of AndroidFlash[which is why I haven't dropped XP],
    Any way I will probably try the script now to see if I can solve for 7 failed updates...

  • Worked great on Windows 10 (1079). Thank you !

  • Hi VG, Date 22-07-2015. Tuticorin, India
    I can’t able to install any update in Windows 10 Insider Preview build 10162 after download the update files. Then I got following report
    TH1 Professional 10240 - Error 0x80246017
    • Definition Update for Windows Defender - KB2267602 (Definition 1.201.2319.0) - Error 0x80240017
    • Definition Update for Windows Defender - KB2267602 (Definition 1.201.2348.0) - Error 0x80070643
    After seeing Ur article i.e.” Fix Windows Update Problems Using Automatic Reset Script”, then I run the Automatic Reset Script. Your script fixed my problem. Today TH1 Professional 10240
    Successfully Upgraded in my PC. This info may help to others like me.
    Thank you so much.

  • System error 5 is thrown?

  • Hi VG,

    I ran the script, but WU still cannot find updates - it just searches - on and on.......

    I copied some relevant content form the log, it hangs on these repeated DTASTOR warnings below.

    Any ideas for me?

    Thank you.
    _____________________________________________________________________________________________________
    +++++++++++ PT: Synchronizing server updates +++++++++++
    2015-09-27 15:21:10:387 1012 360 PT + ServiceId = {9482F4B4-E343-43B6-B170-9A65BC822C77}, Server URL = fe2.update.microsoft.com/v6/ClientWebService/client.asmx
    2015-09-27 15:21:10:512 1012 360 PT WARNING: Cached cookie has expired or new PID is available
    2015-09-27 15:21:10:621 1012 360 PT WARNING: PTWarn: Anonymous plug-in skipped for WU
    PT +++++++++++ PT: Synchronizing extended update info +++++++++++
    2015-09-27 15:30:33:770 1012 360 PT + ServiceId = {9482F4B4-E343-43B6-B170-9A65BC822C77}, Server URL = fe2.update.microsoft.com/v6/ClientWebService/client.asmx
    2015-09-27 15:30:41:202 1012 360 DtaStor WARNING: Attempted to add URL download.windowsupdate.com/msdownload/update/software/secu/2011/07/windows6.1-kb2562937-x64_c74b96b846564d2e7a109a9267a1a40a036f85aa.msu for file x0uWuEZWTS56EJqSZ6GkCgNvhao= when file has not been previously added to the datastore
    2015-09-27 15:30:41:202 1012 360 DtaStor WARNING: Attempted to add URL download.windowsupdate.com/msdownload/update/software/dflt/2011/08/4795504_b3e2e1565f79e543ea2ecd659c6f5a454b8c34fb.cab for file s+LhVl955UPqLs1lnG9aRUuMNPs= when file has not been previously added to the datastore
    2015-09-27 15:30:41:202 1012 360 DtaStor WARNING: Attempted to add URL download.windowsupdate.com/msdownload/update/software/dflt/2011/08/4750242_3ef417aac455280b17cacefb0ec5c78426eca5ca.cab for file PvQXqsRVKAsXys77DsXHhCbspco= when file has not been previously added to the datastore
    2015-09-27 15:30:41:203 1012 360 DtaStor WARNING: Attempted to add URL download.windowsupdate.com/msdownload/update/software/dflt/2011/06/4421317_8868a6e43681c35ce89ff4bf6c7551cdc6078751.cab for file iGim5DaBw1zon/S/bHVRzcYHh1E= when file has not been previously added to the datastore
    2015-09-27 15:30:41:203 1012 360 DtaStor WARNING: Attempted to add URL http

  • VG

    ^^ First try to clear Internet Explorer cache and cookies and then run Windows Update again.

    If it doesnt help you, uninstall all existing .NET Framework versions from Control Panel -> Programs and Features. Run the windows update reset script again, restart computer and then run Windows Update again

  • Hi,
    Do I run your windows reset script in Safe Mode on my Vista Home Premium SP2 laptop or do I run it in 'normal' mode? What happens in normal mode is that when I right click on your batch file it does not ask me to run as administrator (I am the admin), it asks me to Open or Explore the file. Please advise. Thanks.
    P.S. I've kept getting the 8E5E03FA Windows Update error for the past couple of weeks whenever I try and install Windows updates, probably because I rendered my system unstable by constantly having to End Process in Task Manager for Firefox and now Chrome (after uninstalling Firefox) because these browseres are hogging huge amounts of memory when they are running. I have a dual core Toshiba Satellite Pro with 4 Gig of RAM.

  • VG

    ^^ Are you trying to run manually created script or the ready-made script given above for download?

  • Hi VG and thanks for replying so quickly. I am trying to run the the ready-made script. I've downloaded it to my desktop.
    Regards.

  • VG

    ^^ Try to direct run the script.

  • Hi VG,
    When I tried to directly run the downloaded batch script, as you suggested, I got a 'System 5 Access is Denied' error for each line of the batch file. Surely I need to run the batch file as Administrator? If so, how do I do this? Do I start in Windows Safe Mode? Do I copy and paste the other script you have into a text file and then copy it into Safe Mode DOS? I'm not a computer technician, so I need precise instructions for each step.
    Regards.

  • Excellent Solution! Even Microsoft has not had such an easy way of restoring Windows Update failures. This script file fixed in less than a minute.Outstanding Solution!

  • There's only one certain way to fix Windows Update permanently and that's to buy an Apple MacBook Pro, which is what I'm in the process of doing now, after VG/DTM's so-called 'Windows Update fix' went 'System 5 error Access Denied' up and I've waited in vain for any help from said 'fixers'. From now on, I'm going to put my trust in the Apple professionals, not the Windows amateurs. Way to go.

  • Terry rightclick the file: option = Run as administrator

  • After following your suggestion "uninstall all existing .NET Framework versions"
    My window 7 laptop stop "checking update" for hours and found 198 updates. But it taking 2 hours already now
    still got 0% complete. Can you help me out here. Thanks.

  • VG, does it works fully with Windows 10?
    It says catroot2 file not found.
    If you improve this script for windows 10, I would be very grateful

  • Thanks VG and DTM, finally this script solved my problem @windows7ultimate

  • Brilliant - Thank you very much. Worked amazing on a Windows 2008 R2 production server.

  • How come Microsoft doesn't have tools like this one. I've tried everything they suggested with no success. This batch file simply works!!! Thanks

  • this fixed my Win 7 Home Premium finally after everything else failed!
    look here: support.microsoft.com/en-us/kb/3138612

  • Next time updating Vista gives problems, I will try I this tip. Funny that updating Linux (Mint and Debian) always works, and I do mean always.

  • Thanks so much for this little batch file - I was struggling like billyo with Windows 7 64 bit updates just saying Checking for updates straight after a clean install. I tried all of Microsofts troubleshooters, fixits etc plus a few other things that I saw when googling but the only thing that resolved it for me was your neat little batch file so not sure whats in there that isn't in the others but thank you so much, now successfully downloading 280+ updates :o
    Much appreciated

    Jimbo

  • This seems too good to be true! Thank You, Thank You! After all effort this was the one!

  • Hi, my Windows 10 laptop cannot install Update for Microsoft Visual C++ 2012 Update 4 Redistributable Package (KB3119142). Every time I check for updates, this will always appear. please give an idea on how to install this. Thank you.

  • Vg,ran script and when it finished rebooted computer ran updates and it returned error code
    7008000e,any help ive been having this problem a month and nothing fixes i try.

  • VG

    ^^ You should try to repair Windows using setup disc or try sfc /scannow command.

  • 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

  • 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

  • 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.

  • 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"

  • Has anyone tried this on a Windows Server 2012 R2?

Leave a Comment

(required)