While it works well most of the time, problems with Windows Update can be very, very frustrating. There’s often no specific fix for whatever specific situation you’re faced with, other than to “keep trying” or “let it run”…
… neither of which helps in many cases.
Fortunately, Microsoft has outlined what I’ll call the nuclear option: resetting Windows Update completely. Regardless of the problem you’re faced with, if it involves Windows Update, I suggest you give this a try.
To “Fix It” or not to “Fix It”
Microsoft currently has a Knowledge Base article, How do I reset Windows Update components?, that includes both manual instructions to fix Windows Update (which I’ll cover below), and tools you can download and run to automatically fix Windows Update.
For Windows 10, it’s the “Windows Update Troubleshooter”, and for prior versions of Windows, there are “Fix It” troubleshooters.
I strongly recommend you first try the tool appropriate to your version of Windows. In theory, it’ll perform the manual steps for you, and presumably resolve any issues that can be resolved.
Hopefully that will work, and you won’t even need to read the rest of this article.
Of course, with software being as complex as it is, I don’t expect this to work in 100% of all cases. If these tools don’t resolve the issue you’re facing, it’s time to perform steps manually. As you’ll see, they’re quite arcane, which is why the automated “fix it” is much preferred.”
#1: Following the instructions below incorrectly – heck, perhaps even following them correctly – could damage your Windows installation. I strongly recommend that you take a complete image backup prior to performing these steps, and that you be prepared to restore that image backup should something go wrong. Something shouldn’t go wrong, but an image backup will protect you – should I be wrong about something not going wrong.
#2: By following the instructions below, or downloading and using the batch files I’ll provide, you are assuming complete responsibility for the results. For all I know, there’s something special about your machine I cannot predict or account for. While it’s certainly not the intent, the instructions and/or my batch files might render your computer unbootable. Once again, your best defense is the previous important note #1.
#3: Since several of the steps below are sequences of commands to be entered into a command prompt, I’ll provide a few batch files that will run those for you. DO NOT just click and run. Instead, download the file by right clicking and saving to a location on your computer. You’ll run those batch files from within an administrative command prompt. Since these are text files, you can examine their contents at will. Note that since they are considered executable files, your security software may need to be told to “allow” the download.
Fix Windows Update manually
Run Command Prompt as administrator
All of the steps that follow require administrative privileges. It’s not enough that your log-in account be administrator; you need to run the Windows Command Prompt as administrator for those privileges to be in effect.
In versions of Windows prior to 8.1, right click on a Windows Command Prompt shortcut, and click on Run As Administrator.
In Windows 8.1 or 10, right click on the Start menu and click on Command Prompt (admin).
First, we’ll stop several Windows services. Type the following into the command prompt, each line followed by Enter:
net stop bits net stop wuauserv net stop appidsvc net stop cryptsvc
Or download and run stop-services.cmd.
Don’t worry if some of the services report an error that they’re not running.
Delete download manager files
Next, we’ll delete a set of files related to the download manager.
Del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"
Or download and run delete-qmgr-files.cmd.
Reset software distribution
Microsoft recommends you perform this step only if running through these instructions without this step did not resolve the problem. They also state that this step is performed by the “Aggressive” mode of the various “fix it” solutions mentioned earlier.
Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak
Ren %systemroot%\system32\catroot2 catroot2.bak
sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
What Microsoft doesn’t mention is that the first two commands will fail if they’ve been run before – meaning that if the backup folder “%systemroot%\SoftwareDistribution.bak” already exists, or the backup folder “%systemroot%\system32\catroot2.bak” exists, the rename will fail. If that happens, do not proceed until you have removed the pre-existing “.bak” folders manually. Since “%systemroot%” is typically “C:\Windows”, look for “C:\Windows\SoftwareDistribution.bak” and “C:\Windows\system32\catroot2.bak”, and either rename them to something else, or delete them. (You did take that image backup, right? 🙂 ).
Here’s a batch file that includes those commands, but also pauses after the rename to give you an opportunity to abort: reset-software-distribution.cmd.
Enter the following commands, exactly:
cd /d %windir%\system32
regsvr32.exe atl.dll regsvr32.exe urlmon.dll regsvr32.exe mshtml.dll regsvr32.exe shdocvw.dll regsvr32.exe browseui.dll regsvr32.exe jscript.dll regsvr32.exe vbscript.dll regsvr32.exe scrrun.dll regsvr32.exe msxml.dll regsvr32.exe msxml3.dll regsvr32.exe msxml6.dll regsvr32.exe actxprxy.dll regsvr32.exe softpub.dll regsvr32.exe wintrust.dll regsvr32.exe dssenh.dll regsvr32.exe rsaenh.dll regsvr32.exe gpkcsp.dll regsvr32.exe sccbase.dll regsvr32.exe slbcsp.dll regsvr32.exe cryptdlg.dll regsvr32.exe oleaut32.dll regsvr32.exe ole32.dll regsvr32.exe shell32.dll regsvr32.exe initpki.dll regsvr32.exe wuapi.dll regsvr32.exe wuaueng.dll regsvr32.exe wuaueng1.dll regsvr32.exe wucltui.dll regsvr32.exe wups.dll regsvr32.exe wups2.dll regsvr32.exe wuweb.dll regsvr32.exe qmgr.dll regsvr32.exe qmgrprxy.dll regsvr32.exe wucltux.dll regsvr32.exe muweb.dll regsvr32.exe wuwebv.dll
Or download and run register-dlls.cmd.
You will have to click an OK button for each one. In addition, several will fail:
As unnerving as that may seem, that’s OK. Not every system is configured the same way, and thus not every DLL will be present.
Reset the network
Reset network components with the following commands1:
netsh winsock reset
netsh winhttp reset proxy
Or download and run reset-network.cmd.
Now we restart the services that we stopped earlier.
net start bits net start wuauserv net start appidsvc net start cryptsvc
Or download and run start-services.cmd.
Install Windows Update Agent
Microsoft’s instructions include installing the most recent version of the Windows Update Agent, which you can do here.
There are no instructions for Windows 10, so presumably this is not an option for Windows 10-related issues at this time.
Naturally, much of what we’ve done will require a reboot to take final effect.
What did we just do?
After all that mumbo-jumbo, you’re probably wondering what it is you just did – be it manually or with a fix-it tool.
The best analogy I can come up with is that this is very similar to clearing your browser cache. Just as your web browser tries to avoid multiple downloads and generally speed up your web browsing experience by keeping many things in a cache on your machine’s hard disk, Windows update does something similar. Rather than re-analyzing, slowing down your system, and perhaps even downloading information repeatedly, it caches much of what it learns about your system on disk.
And just like the browser, sometimes the cache can get “confused”.
We’ve simply cleared out the cache and reset a few things to known states, so that Windows Update can start with a clean slate.
(To be clear, browser caches and the Windows update cache are completely unrelated to one another. The concepts are just similar.)