7/7/09

Delete Backup Hotfix Folder

If you have a Windows Server, at times the C drive will contain hidden Hotfix folders that are maintain in the Server and taking away valuable space. These files usually start with $ character. In order to delete the files create in Notepad a file named DeleteHotFixBackups and copy and paste the script below to later change the file extension to .bat
Please note that deleting HotFixes is risky if your trying to uninstall a particular HotFix. Also you can accidentally delete backup folders because some backup folder do begin with $.

DeleteHotFixBackups.bat

C:
CD %WINDIR%
Del kb*.log
For /F "usebackq delims=" %%W in ('dir/d/b/ah $*.*') Do RD %%W /S /Q