Rem Batch file written by From: "Michael D. Ober"
Rem and published to WSUS newsgroup Jan 2006
pushd "C:\Program Files\Update Services\Tools"
Rem Set a Logfile folder
Set LogDir=C:\Program Files\Update Services\Tools\Logs
for /F "tokens=1" %%a in ('date /t') do set day=%%a
for /F "tokens=2" %%a in ('date /t') do set date=%%a
for /F "tokens=1, 2, 3 delims=/" %%a in ("%date%") do set date=%%c%%a%%b
set logfile="%LogDir%\WSUSCleanUp\%USERNAME% on %COMPUTERNAME% - %date%.log"
echo Stopping WSUS %date%:%time%>> %logfile%
net stop "Update Services" >> %logfile%
echo Deleting Unneeded Revisions %date%:%time%>> %logfile%
wsusutil.exe deleteunneededrevisions >> %logfile%
echo Starting WSUS %date%:%time%>> %logfile%
net start "Update Services" >> %logfile%
WsusDebugTool.exe /Tool:PurgeUnneededFiles >> %logfile%
echo Finished %date%:%time%>> %logfile%
Open in new window
Get your personalized solution.
Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.
*This site is protected by reCAPTCHA and the Google
Terms of Service apply.
Please enter a first name
Please enter a last name
8+ characters (letters, numbers, and a symbol)
Take hold of your future.