Skip to content

Instantly share code, notes, and snippets.

@mjmcfalls
Created December 8, 2010 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjmcfalls/732797 to your computer and use it in GitHub Desktop.
Save mjmcfalls/732797 to your computer and use it in GitHub Desktop.
Reset Windows Update
@echo off
REM Reset Windows update batch file (kb971058)
cls
:START
set /p osname=ver
set /p aggro="Aggressive Fix(N/y): "
rem if /i %aggro%==n ( GOTO :NO ) ELSE ( if /i %Aggro%==y ( GOTO :AGGRESSIVE ELSE ( GOTO :ERR ) )
if /i %aggro%==n ( GOTO :MAIN ) ELSE ( if /i %Aggro%==y ( GOTO :MAIN ) ELSE ( GOTO :ERR ) )
:ERR
CLS
Echo Invalid option!!
echo.
GOTO START
:MAIN
net stop bits
net stop wuauserv
Del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"
if /i %aggro%==n ( GOTO :DLLS ) ELSE ( if /i %Aggro%==y ( GOTO :AGGRESIVE ) )
:DLLS
Ren %systemroot%\SoftwareDistribution\DataStore *.bak
Ren %systemroot%\SoftwareDistribution\Download *.bak
Ren %systemroot%\system32\catroot2 *.bak
cd /d %windir%\system32
regsvr32.exe /s /s atl.dll
regsvr32.exe /s /s urlmon.dll
regsvr32.exe /s /s mshtml.dll
regsvr32.exe /s /s shdocvw.dll
regsvr32.exe /s /s browseui.dll
regsvr32.exe /s /s jscript.dll
regsvr32.exe /s /s vbscript.dll
regsvr32.exe /s scrrun.dll
regsvr32.exe /s msxml.dll
regsvr32.exe /s msxml3.dll
regsvr32.exe /s msxml6.dll
regsvr32.exe /s actxprxy.dll
regsvr32.exe /s softpub.dll
regsvr32.exe /s wintrust.dll
regsvr32.exe /s dssenh.dll
regsvr32.exe /s rsaenh.dll
regsvr32.exe /s gpkcsp.dll
regsvr32.exe /s sccbase.dll
regsvr32.exe /s slbcsp.dll
regsvr32.exe /s cryptdlg.dll
regsvr32.exe /s oleaut32.dll
regsvr32.exe /s ole32.dll
regsvr32.exe /s shell32.dll
regsvr32.exe /s initpki.dll
regsvr32.exe /s wuapi.dll
regsvr32.exe /s wuaueng.dll
regsvr32.exe /s wuaueng1.dll
regsvr32.exe /s wucltui.dll
regsvr32.exe /s wups.dll
regsvr32.exe /s wups2.dll
regsvr32.exe /s wuweb.dll
regsvr32.exe /s qmgr.dll
regsvr32.exe /s qmgrprxy.dll
regsvr32.exe /s wucltux.dll
regsvr32.exe /s muweb.dll
regsvr32.exe /s wuwebv.dll
if ver | find /i "xp" ( proxycfg.exe -d )
if ver | find /i "2003" (proxycfg.exe -d )
if ver | find /i "vista" ( bitsadmin.exe /reset /allusers ) else (netsh winhttp reset proxy)
GOTO :END
:AGGRESIVE
REM Aggressive Fix
rem %systemroot%\SoftwareDistribution\DataStore
rem %systemroot%\SoftwareDistribution\Download
rem %systemroot%\system32\catroot2
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)
GOTO :DLLS
REM End of Aggressive fix
:END
netsh winsock reset
net start bits
net start wuauserv
shutdown -r -t 60 -c "Restart for Update fix"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment