I have come across a problem, on a number of occasions, where PCs under my control fail to load new updates successfully. This is true whether they are attempting to apply via the Automatic Updates facility built into the OS or whether accessing the MS Update site directly.
Reason :
The problem is often associated with DLL files not being correctly set up for some reason. Most of the suggested fixes involve registering a list of DLL files on the PC manually. One cause of this I'm aware of in more detail is that whenever you need to use the Repair facility (Boot from an original XP Install CD and choose this option) this is likely to be a side-effect (At least from XP SP2).
Solution(s) :
I will include a couple of CMD files that do the fix for you. The XP version seems to work OK for Windows 2000 as well, but the 2003 version has not yet been tested (I've not come across the problem on any 2003 servers).
Although they mainly reflect the info found in the two links (http://support.microsoft.com/kb/943144 for Windows XP & http://support.microsoft.com/kb/555989 for Windows Server 2003), other files may have been added over time to cover more cases.
Where I have used "@ECHO ON" near the top to show what's going on during execution, you can change this to "@ECHO OFF" if you'd like it to run silently or secretively.
MSUpdateFixXP.Cmd :
Expand|Select|Wrap|Line Numbers
- @Rem http://support.microsoft.com/kb/943144
- @ECHO ON
- IF .%1 == ./? GOTO HELP
- IF .%1 == .HELP GOTO HELP
- IF .%1 == .help GOTO HELP
- GOTO MAIN
- :HELP
- ECHO Usage (for XP PCs): MSUpdateFixXP
- ECHO This CMD script should re-enable a PC
- ECHO to use Windows Update if it's failing.
- ECHO This typically occurs after a REPAIR is done
- ECHO from the original XP install CD.
- GOTO ENDSCRIPT
- :MAIN
- REGSVR32 /S %WinDir%\System32\Wuapi.Dll
- REGSVR32 /S %WinDir%\System32\wups.Dll
- REGSVR32 /S %WinDir%\System32\Wuaueng.Dll
- REGSVR32 /S %WinDir%\System32\Wucltui.Dll
- REGSVR32 /S %WinDir%\System32\Msxml3.Dll
- NET STOP WUAUSERV >NUL
- IF NOT ERRORLEVEL 1 GOTO CONTINUE1
- ECHO WUAUSERV (Windows Update & Automatic Service) failed to stop.
- GOTO ENDSCRIPT
- :CONTINUE1
- REGSVR32 /S %WinDir%\System32\Wups2.Dll
- :ENDSCRIPT
- NET START WUAUSERV >NUL
- ECHO ON
Expand|Select|Wrap|Line Numbers
- Rem http://support.microsoft.com/kb/555989
- Rem NB Both services MUST be stopped before the rename will work.
- @ECHO OFF
- IF .%1 == ./? GOTO HELP
- IF .%1 == .HELP GOTO HELP
- IF .%1 == .help GOTO HELP
- GOTO MAIN
- :HELP
- ECHO Usage: MSUpdateFix [DRASTIC]
- ECHO This CMD script should re-enable a PC to use Windows Update if it's failing.
- ECHO Generally use the DRASTIC option only if the normal (no parameter) option fails.
- GOTO ENDSCRIPT
- :MAIN
- REGSVR32 /S %WinDir%\System32\Vbscript.Dll
- REGSVR32 /S %WinDir%\System32\Mshtml.Dll
- REGSVR32 /S %WinDir%\System32\Msjava.Dll
- REGSVR32 /S %WinDir%\System32\Jscript.Dll
- REGSVR32 /S %WinDir%\System32\Msxml.Dll
- REGSVR32 /S %WinDir%\System32\Actxprxy.Dll
- REGSVR32 /S %WinDir%\System32\Shdocvw.Dll
- IF .%1 == .DRASTIC GOTO DRASTIC
- IF .%1 == .drastic GOTO DRASTIC
- GOTO ENDSCRIPT
- :DRASTIC
- NET STOP WUAUSERV
- IF NOT ERRORLEVEL 1 GOTO CONTINUE1
- ECHO WUAUSERV (Windows Update & Automatic Service) failed to stop.
- GOTO ENDSCRIPT
- :CONTINUE1
- NET STOP CryptSvc
- IF NOT ERRORLEVEL 1 GOTO CONTINUE2
- ECHO CryptSvc (Cryptographic Service) failed to stop.
- GOTO ENDSCRIPT
- :CONTINUE2
- DEL /F /S /Q %WinDir%\System32\Catroot2 >NUL
- IF NOT ERRORLEVEL 1 GOTO CONTINUE3
- ECHO Unable to delete %WinDir%\System32\Catroot2.
- GOTO ENDSCRIPT
- :CONTINUE3
- DEL /F /S /Q %WinDir%\SoftDistBup >NUL
- REN %WinDir%\SoftwareDistribution SoftDistBup >NUL
- IF NOT ERRORLEVEL 1 GOTO CONTINUE4
- ECHO Unable to rename %WinDir%\SoftwareDistribution to %WinDir%\SoftDistBup.
- GOTO ENDSCRIPT
- :CONTINUE4
- NET START CryptSvc
- IF NOT ERRORLEVEL 1 GOTO CONTINUE5
- ECHO CryptSvc (Cryptographic Service) failed to restart.
- GOTO ENDSCRIPT
- :CONTINUE5
- NET START WUAUSERV
- IF NOT ERRORLEVEL 1 GOTO CONTINUE6
- ECHO WUAUSERV (Windows Update & Automatic Service) failed to restart.
- GOTO ENDSCRIPT
- :CONTINUE6
- REGSVR32 /S Softpub.Dll
- REGSVR32 /S Mssip32.Dll
- REGSVR32 /S Initpki.Dll
- REGSVR32 /S Softpub.Dll
- REGSVR32 /S Wintrust.Dll
- REGSVR32 /S Initpki.Dll
- REGSVR32 /S Dssenh.Dll
- REGSVR32 /S Rsaenh.Dll
- REGSVR32 /S Gpkcsp.Dll
- REGSVR32 /S Sccbase.Dll
- REGSVR32 /S Slbcsp.Dll
- REGSVR32 /S Cryptdlg.Dll
- REGSVR32 /S Urlmon.Dll
- REGSVR32 /S Shdocvw.Dll
- REGSVR32 /S Msjava.Dll
- REGSVR32 /S Actxprxy.Dll
- REGSVR32 /S Oleaut32.Dll
- REGSVR32 /S Mshtml.Dll
- REGSVR32 /S Msxml.Dll
- REGSVR32 /S Msxml2.Dll
- REGSVR32 /S Msxml3.Dll
- REGSVR32 /S Browseui.Dll
- REGSVR32 /S Shell32.Dll
- REGSVR32 /S Wuapi.Dll
- REGSVR32 /S Wuaueng.Dll
- REGSVR32 /S Wuaueng1.Dll
- REGSVR32 /S Wucltui.Dll
- REGSVR32 /S Wups.Dll
- REGSVR32 /S Wuweb.Dll
- REGSVR32 /S Jscript.Dll
- REGSVR32 /S Atl.Dll
- REGSVR32 /S Mssip32.Dll
- :ENDSCRIPT
- NET START CryptSvc >NUL
- NET START WUAUSERV >NUL
- ECHO ON
I can't guarantee this will fix all situations, but I would be interested to hear if this fails to execute for any reason.