Set oShell = CreateObject("WScript.Shell") sRegKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" pRegKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" ' suppress error in case values does not exist On Error Resume Next ' check for marker sIDDeleted = oShell.RegRead( sRegKey & "\IDDeleted") ' to be sure values is only deleted once, test on marker If sIDDeleted <> "yes" Then ' delete any WinHttpSettings registry entry (interferes with WSUS) oshell.RegDelete pRegKey & "\WinHttpSettings" ' delete values oShell.RegDelete sRegKey & "\AccountDomainSid" oShell.RegDelete sRegKey & "\PingID" oShell.RegDelete sRegKey & "\SusClientId" ' Stop and start the Automatic updates service oShell.Run "%SystemRoot%\system32\net.exe stop wuauserv", 0, True oShell.Run "%SystemRoot%\system32\net.exe start wuauserv", 0, True ' Run wuauclt.exe with resetauthorization sCmd = "%SystemRoot%\system32\wuauclt.exe /resetauthorization /detectnow" oShell.Run sCmd, 0, True ' create marker oShell.RegWrite sRegKey & "\IDDeleted", "yes" End If