I’ve had this around for the longest time and figured I better put it here before I lose it forever to the dying Microsoft releases.
Note: This also cleans up VMware temporary files which build up over time. See this post for more information: VMware Tray Dump Files Chewing up Space
Update: Added line to remove Temporary Internet Files directory/subdirectories also.
@echo off
setlocal
@for /d %%d in ( C:\Documents and Settings\* ) do @(
echo %%d
if exist %%d\Application Data\VMware (
del /q %%d\Application Data\VMware\*.*
)
if exist %%d\Local Settings (
if exist %%d\Local Settings\Temp (
for /d %%e in ( %%d\Local Settings\Temp\* ) do @(
attrib -R -A -S -H %%e\*.*
rmdir %%e /s /q
)
if exist %%d\Local Settings\Temporary Internet Files (
rmdir %%d\Local Settings\Temporary Internet Files /s /q
)
if exist %%d\Local Settings\Temp\*.* (
attrib -R -A -S -H %%d\Local Settings\Temp\*.*
del %%d\Local Settings\Temp\*.* /q
)
)
)
)
Great tool! Thanks to your tips-tools-help we are not Caffeine Addicted because you save us a lot of time and we have time also to sleep!!!
Hi Assos,
Glad I could save you some sleep! =) Thanks for the feedback.
-Rich