Created
October 22, 2012 05:20
-
-
Save garthk/3929809 to your computer and use it in GitHub Desktop.
Clean up stale Windows Update downloads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo on | |
| setlocal | |
| set DAYS=31 | |
| set DOWNLOADS=C:\WINDOWS\SoftwareDistribution\Download | |
| rem http://bit.ly/IttCwo | |
| rem http://stackoverflow.com/a/51069/5700 | |
| net stop wuauserv | |
| forfiles /p %DOWNLOADS% /s /d -%DAYS% /c "cmd /c if @isdir==FALSE (del @file) else (rd /s /q @file)" | |
| net start wuauserv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment