Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- cls
- rem
- rem Set the title and above clear the screen,
- rem Then set the text color to white.
- rem
- title Windows Update Resetting Tool
- color 0f
- rem
- rem Stop the services so that they don't overwrite data.
- rem
- net stop wuauserv
- net stop bits
- rem
- rem Take ownership of these files along with granting full control,
- rem If there are already old files present, Remove them then,
- rem rename the current folders to old folders so that we can attempt to fetch again.
- rem
- takeown /f "%SystemRoot%\SoftwareDistribution" /a
- icacls "%SystemRoot%\SoftwareDistribution" /grant Administrators:(F)
- takeown /f "%SystemRoot%\system32\catroot2" /a
- icacls "%SystemRoot%\system32\catroot2" /grant Administrators:(F)
- takeown /f "%SystemRoot%\syswow64\catroot2" /a
- icacls "%SystemRoot%\syswow64\catroot2" /grant Administrators:(F)
- if exist "%SystemRoot%\softwaredistribution.old" del "%SystemRoot%\softwaredistribution.old" /q
- ren "%SystemRoot%\SoftwareDistribution" "SoftwareDistribution.old"
- if exist "%SystemRoot%\system32\catroot2.old" del "%SystemRoot%\system32\catroot2.old" /q
- ren "%SystemRoot%\system32\catroot2" "catroot2.old"
- if exist "%SystemRoot%\syswow64\catroot2.old" del "%SystemRoot%\syswow64\catroot2.old" /q
- ren "%SystemRoot%\syswow64\catroot2" "catroot2.old"
- rem
- rem Jump to the system32 folder.
- rem
- cd %SystemRoot%\system32
- rem
- rem Re-Register the DLLs if they are not present in registry yet.
- rem
- regsvr32 atl.dll /s
- regsvr32 urlmon.dll /s
- regsvr32 mshtml.dll /s
- regsvr32 shdocvw.dll /s
- regsvr32 browseui.dll /s
- regsvr32 jscript.dll /s
- regsvr32 vbscript.dll /s
- regsvr32 scrrun.dll /s
- regsvr32 msxml.dll /s
- regsvr32 msxml3.dll /s
- regsvr32 msxml6.dll /s
- regsvr32 actxprxy.dll /s
- regsvr32 softpub.dll /s
- regsvr32 wintrust.dll /s
- regsvr32 dssenh.dll /s
- regsvr32 rsaenh.dll /s
- regsvr32 gpkcsp.dll /s
- regsvr32 sccbase.dll /s
- regsvr32 slbcsp.dll /s
- regsvr32 cryptdlg.dll /s
- regsvr32 oleaut32.dll /s
- regsvr32 ole32.dll /s
- regsvr32 shell32.dll /s
- regsvr32 initpki.dll /s
- regsvr32 wuapi.dll /s
- regsvr32 wuaueng.dll /s
- regsvr32 wuaueng1.dll /s
- regsvr32 wucltui.dll /s
- regsvr32 wups.dll /s
- regsvr32 wups2.dll /s
- regsvr32 wuweb.dll /s
- regsvr32 qmgr.dll /s
- regsvr32 qmgrprxy.dll /s
- regsvr32 wucltux.dll /s
- regsvr32 muweb.dll /s
- regsvr32 wuwebv.dll /s
- rem
- rem Jump to windows directory.
- rem
- cd %SystemRoot%
- rem
- rem Reset the permission presets for both services.
- rem
- sc sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
- sc sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
- rem
- rem Start the services back up.
- rem
- net start bits
- net start wuauserv
- rem
- rem Create an event viewer log in case if this needs a reminder.
- rem
- eventcreate /T Information /ID 24 /L System /SO WindowsUpdate /D "The windows update cache has been reset, You may have to check for updates again."
- rem
- rem End the batch session.
- rem
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement