<< Back to Script Library

Cleanup Windows Update client

Full Windows Updates client cleanup. The script clears the BITS queued jobs, clears the software distriobution folder and clears SUSClient ID. It then restarts BITS and the Windows Update client and rechecks for updates.
Version: 2.2.4
Created: 2016-09-17
Modified: 2017-02-15
Creator: Ken McEvoy
Downloads: 481
Tags: Windows Update WSUS
The Script Copy Script Copied to clipboard
@echo off
net stop wuauserv && net stop bits
ipconfig /flushdns
Ren "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr0.dat" qmgr0.dat.old
Ren "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr1.dat" qmgr1.dat.old
del /s "%windir%\SoftwareDistribution\*.*" /q
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
net start bits
net start wuauserv
wuauclt /resetauthorization /detectnow
echo BITS/Windows Update client reset is complete.