Delete Hotfix folders in %windir%

Open notepad copy and paste the script below and save it as .BAT extension
Tested on WinXP

C:
CD %WINDIR%
Del kb*.log
For /F “tokens=* delims= ” %%W in (‘dir/b/ah $Nt*’) Do RD %%W /S /Q

Delete hidden folders
takeown /f “.\$WINDOWS.~BT” /a /r /d y
icacls “c:\$WINDOWS.~BT\*” /t /grant everyone:f
rd /s “c:\$WINDOWS.~BT\”

takeown /f c:\windows.old /a /r /d y
icacls c:\windows.old\* /t /grant everyone:f
rd /s c:\windows.old

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: