Microsoft/Windows Update Fails on Every Update

Occasionally, Windows Update (or Microsoft Update) will see all of the updates you need (and possibly even download them) but will immediately fail all of the updates when trying to install them.  Sometimes I have seen Windows Update error off after the green progress bar and before it can show me if there are any updates at all.

Every time this happens, I end up Googling the error code and finding the same fix every time (since I forget what the fix is each time).  The error code I get is 0x80004002.  If you are unable to find the error code through the UI, you can check the Windows Update log at %WINDIR%\WindowsUpdate.log (which in my case, %WINDIR% translated to C:\WINDOWS\); you can even just type %WINDIR%\WindowsUpdate.log right into the "Run…" dialog.  You can find the error code near the bottom of the log; just find the lines of text that have the same timestamp as when you unsuccessfully ran Windows Update.

Well, anyway, here’s the fix; run the following commands in a Command Prompt window (type cmd in the "Run…" dialog):

net stop wuauserv
regsvr32 wups2.dll
net start wuauserv

That’s all there is to it!  It has worked every time for me.  It may even be helpful to put these commands in a batch script (copy and paste the commands into Notepad and then save the text file with a .bat file extension) and keep the file in a place where you can easily find it again.