Advertisement
dantpro

Reset Windows Update Agent

Jul 1st, 2014
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.29 KB | None | 0 0
  1. @echo off
  2. cls
  3.  
  4. REM ==================================================================================
  5. REM DESCRIPTION    : This script resets all of Windows Update Agent settings.
  6. REM AUTHOR         : Luca Fabbri
  7. REM VERSION HISTORY: 1.2 - Stop SMS Host Agent (SCCM Client) Service added
  8. REM                  1.0 - Start
  9. REM http://gallery.technet.microsoft.com/scriptcenter/Dos-Command-Line-Batch-to-fb07b159
  10. REM ==================================================================================
  11.  
  12. @echo 1. Stopping Automatic Updates, BITS and SMS Host Agent Services...
  13. net stop wuauserv
  14. net stop bits
  15. net stop ccmexec
  16.  
  17. @echo 2. Deleting AU cache folder and log file...
  18. del /f /q %SystemRoot%\WindowsUpdate.log
  19. del /f /s /q %SystemRoot%\SoftwareDistribution\*.*
  20. REM @echo 2. Renaming AU cache folder and log file...
  21. REM ren %SystemRoot%\WindowsUpdate.log %SystemRoot%\WindowsUpdate.bak
  22. REM ren %SystemRoot%\SoftwareDistribution %SystemRoot%\SoftwareDistribution.bak
  23.  
  24. @echo 3. Re-registering DLL files...
  25. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\atl.dll
  26. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\jscript.dll
  27. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\msxml3.dll
  28. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\softpub.dll
  29. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuapi.dll
  30. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuaueng.dll
  31. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuaueng1.dll
  32. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wucltui.dll
  33. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wups.dll
  34. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wups2.dll
  35. %SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuweb.dll
  36.  
  37. @echo 4. Removing WSUS Client Id...
  38. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
  39. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
  40. REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
  41.  
  42. @echo 5. Starting Automatic Updates, BITS and SMS Host Agent Services...
  43. net start ccmexec
  44. net start bits
  45. net start wuauserv
  46.  
  47. @echo 6. Forcing AU discovery...
  48. wuauclt /resetauthorization /detectnow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement