User Tools

Site Tools


computing:windows:del_temp

This is an old revision of the document!


Delete Temporary Files

This script will delete various temporary files and folders in all user profiles.

@echo off
if %os%==Windows_NT goto WINNT
goto NOCON

:WINNT
echo .Using a Windows NT based system
echo ..%computername%

echo Deleting Temporary Internet Files
del /q /f /s "%USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
echo deleted!

echo Deleting Downloads Folder Files
del /q /f /s "%USERPROFILE%\Downloads\*.*"
echo deleted!

echo Deleting Cookies
del /q /f /s "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies\*.*"
del /q /f /s "%USERPROFILE%\AppData\LocalLow\Microsoft\Internet Explorer\DOMStore\*.*"
echo deleted!

echo Deleting History
del /q /f /s "%USERPROFILE%\AppData\Local\Microsoft\Windows\History\*.*"
del /q /f /s "%USERPROFILE%\AppData\Local\Microsoft\Internet Explorer\Recovery\Active\*.*"
del /q /f /s "%USERPROFILE%\AppData\Local\Microsoft\Internet Explorer\Recovery\Last Active\*.*"
echo deleted!

echo Deleting Windows Internet Explorer Dat Files
del /q /f /s "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\PrivacIE\*.*"
del /q /f /s "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\IECompatCache\*.*"
del /q /f /s "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\IETldCache\*.*"
echo deleted!

echo Deleting Windows Error Reporting Files
del /q /f /s "%USERPROFILE%\AppData\Local\Microsoft\Windows\WER\ReportArchive\*.*"
echo deleted!

echo Deleting Flash Player Temp Files
del /q /f /s "%USERPROFILE%\AppData\Roaming\Macromedia\Flash Player\*.*"
echo deleted!

echo Deleting Remote Desktop Cache
del /q /f /s "%USERPROFILE%\AppData\Local\Microsoft\Terminal Server Client\Cache\*.*"
echo deleted!

echo Deleting Profile Temp Files
del /q /f /s "%USERPROFILE%\AppData\Local\Temp\*.*"
echo deleted!

echo Delete misc Files in Profile
del /q /f /s "%USERPROFILE%\webct_upload_applet.properties"
del /q /f /s "%USERPROFILE%\g2mdlhlpx.exe"
del /q /f /s "%USERPROFILE%\fred"
rmdir /s /q "%USERPROFILE%\temp"
rmdir /s /q "%USERPROFILE%\WebEx"
rmdir /s /q "%USERPROFILE%\.gimp-2.4"
rmdir /s /q "%USERPROFILE%\.realobjects"
rmdir /s /q "%USERPROFILE%\.thumbnails"
rmdir /s /q "%USERPROFILE%\Bluetooth Software"
rmdir /s /q "%USERPROFILE%\Office Genuine Advantage"
echo deleted!

echo Deleting FireFox Cache

pushd "%USERPROFILE%\AppData\Local\Mozilla\Firefox\Profiles\*.default\"
del /q /f /s "Cache\*.*"
popd

echo deleted!

echo Deleting User Profile Adobe Temp Files
del /q /f /s "%USERPROFILE%\AppData\LocalLow\Adobe\Acrobat\9.0\Search\*.*"
del /q /f /s "%USERPROFILE%\AppData\LocalLow\Adobe\Common\Media Cache Files\*.*"
del /q /f /s "%USERPROFILE%\AppData\LocalLow\Adobe\Common\Media Cache\*.*"
echo deleted!

echo Deleting User Office Recent Files
del /q /f /s "%USERPROFILE%\AppData\Roaming\Microsoft\Office\Recent\*.*"
echo deleted!

echo Deleting User Office TMP Files
del /q /f /s "%USERPROFILE%\AppData\Roaming\Microsoft\Office\*.tmp"
echo deleted!

goto END

:NOCON
echo Error...Invalid Operating System...
echo Error...No actions were made...
goto END

:END
computing/windows/del_temp.1366225155.txt.gz · Last modified: 2013/04/17 12:59 by gcooper