Script to Delete Temporary Internet Files

Skip Navigation LinksIrocon > Blog > 2008 > March, 2008 > March 29, 2008 > Script to Delete Temporary Internet Files

Script to Delete Temporary Internet Files

This script will populate %%B with the usernames held within the 'c:\Documents and Settings' directory.  The DO statement deletes all users temporary internet folder contents.

FOR /D %%B IN ("c:\Documents and Settings\*")
DO del "%%B\Local Settings\Temporary Internet Files\*.*"  /s /q /f

Unlike the temporary Internet files, there isn't an obvious way to limit the size of the temp directory, so instead I wrote up a batch file to clear out the folder for me. The only line in the file is:

del /q /f /s %temp%\*
Last Updated:Thursday, September 02, 2010By:alfero#

Would you like to comment?

Sign in with your OpenID. If you do not know what OpenID is, find out.