Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to create a Batch file that I can then remotely execute on machines in a workgroup in order to point them at a WSUS installation. I understand it is via the use registry keys:


And then the following key set to 1:


Then to run a wuauclt /reportnow and /detectnow.

Is this possible via batch? Can you create and edit registry keys via batch files?


share|improve this question
up vote 3 down vote accepted

Kindly use below commands to create batch file.

REM Stop the Automatic Updates service
net stop wuauserv

REM Stop the Windows Management Instrumentation service
net stop winmgmt

REM Backup ReportingEvents.log.  Then, delete the contents of
REM  %systemroot%\SoftwareDistribution and
REM  %systemroot%\system32\WBEM\Repository
copy %systemroot%\softwaredistribution\reportingevents.log %homedrive%\
del /f /q %systemroot%\softwaredistribution\*.*
move %homedrive%\reportingevents.log %systemroot%\softwaredistribution

REM Delete SusClientID and AccountDomainSid keys from
REM  HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate
SET WU_KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate
reg delete %WU_KEY% /v SusClientID
reg delete %WU_KEY% /v AccountDomainSid

REM Start the Automatic Updates service
net start wuauserv

REM Start the Windows Management Instrumentation service
net start winmgmt

REM Force a group policy update
gpupdate /force

REM Roll the WU Client...
wuauclt /resetauthorization /detectnow
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.