Try something like this:
Cleanup the temporary internet files by deleting and recreating the directory:
------------------------------------
cd "C:\Documents and Settings"
rem step through all directories here
FOR /D %%F in (*.*) DO (
rem move into the user's local settings
PUSHD "%%F\Local Settings"
rem if temporary internet files exists
rem remove it and all sub directories,
rem the /q (quiet) switch avoids prompts
IF EXIST "Temporary Internet Files" (rd/s/q "Temporary Internet Files")
rem create a new, empty directory
md "Temporary Internet Files"
rem pop back up to the documents and settings directory
rem and go to the next user.
POPD
)
------------------------------------
Clean up the temp directories
(Some description omitted here because it's already in the above script)
------------------------------------
cd "C:\Documents and Settings"
FOR /D %%F in (*.*) DO (
PUSHD "%%F\Local Settings\Temp"
rem delete all the files in this dir
DEL /Q *.*
rem delete all subdirectories in this dir
FOR /D %%D in (*.*) DO RD /S /Q %%D
POPD
)
------------------------------------
Please, PLEASE, PULEEEZE test these thoroughly on a recoverable system - these work on my systems but you may have to make adjustments for your environment. The DEL/Q and RD/S/Q are VERY dangerous (more dangerous than "FORMAT C:" dangerous because you don't get a confirmation prompt before things are wiped out).
You can leave off the /Q on all the DEL and RD commands to get prompted before any damage is done.
Jim
/* If you think the problem is bad now, wait until I solve it! */