dantpro icon

Reset Windows Update Agent

dantpro | PRO | 07/01/14 03:37:13 PM UTC | 0 ⭐ | 835 👁️ | Never ⏰ | []
Batch |

2.29 KB

|

None

|

0 👍

/

0 👎

@echo off
cls
 
REM ==================================================================================
REM DESCRIPTION    : This script resets all of Windows Update Agent settings.
REM AUTHOR         : Luca Fabbri
REM VERSION HISTORY: 1.2 - Stop SMS Host Agent (SCCM Client) Service added
REM                  1.0 - Start
REM http://gallery.technet.microsoft.com/scriptcenter/Dos-Command-Line-Batch-to-fb07b159
REM ==================================================================================
 
@echo 1. Stopping Automatic Updates, BITS and SMS Host Agent Services...
net stop wuauserv
net stop bits 
net stop ccmexec
 
@echo 2. Deleting AU cache folder and log file...
del /f /q %SystemRoot%\WindowsUpdate.log
del /f /s /q %SystemRoot%\SoftwareDistribution\*.*
REM @echo 2. Renaming AU cache folder and log file...
REM ren %SystemRoot%\WindowsUpdate.log %SystemRoot%\WindowsUpdate.bak
REM ren %SystemRoot%\SoftwareDistribution %SystemRoot%\SoftwareDistribution.bak
 
@echo 3. Re-registering DLL files...
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\atl.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\jscript.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\msxml3.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\softpub.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuapi.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuaueng.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuaueng1.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wucltui.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wups.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wups2.dll 
%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\wuweb.dll
 
@echo 4. Removing WSUS Client Id...
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
 
@echo 5. Starting Automatic Updates, BITS and SMS Host Agent Services...
net start ccmexec
net start bits
net start wuauserv
 
@echo 6. Forcing AU discovery...
wuauclt /resetauthorization /detectnow

Comments