Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted (edited)

anybody able to knock up a vbscript that will

 

 

Stop Automatic Update Service

delete "%Windir%\SoftwareDistribution" folder.

delete "%Windir%\windowsUpdate text file

Start Automatic Update Service

reboot system

 

 

(all clients xp pro, windows installed on C drive)

cheers

Edited by projector1
Posted

Drop this in a vbscript and put in in the Computer Section of a GPO that contaisn the computers in question. It forces the pc to check for updates and then leaves a marker in the reg, the next time the pc starts again it will check for the marker and not do the update.

 

 

 

 

'--------------------8<----------------------

Set oShell = CreateObject("WScript.Shell")

 

sRegKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate"

 

' 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 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

'--------------------8<----------------------

Posted

CCleaner does a very good job of getting rid of junk files including windows update crud, and I am pretty sure it can be run from a command line with

"%ProgramFiles%\CCleaner\ccleaner.exe" /AUTO

 

Not that relevant but ccleaner does a damn good job of cleaning up the detritus that xp leaves scattered around your hard drive and its free. (very good for pre ghost images too)

Posted

thanks for the reply

sorry forgot to add, i need this as 90% of the clients are updating.

 

The others are reporting error Error 0x80004002 in the windowsupdate.txt file.

 

I manually carried out the steps mentioned above and it worked. I would like to simplify the task with a script!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...