I was working on a few terminal servers that were extremely low on free disk space on a drive which also contained user profiles. I came across a helpful tool called ICSweep from Ctrl-Alt-Del IT Consultancy and is freeware. You can download it and other tools from http://www.ctrl-alt-del.com.au/CAD_TSUtils.htm.
“ICSweep is a command-line utility to clear the Temporary Internet Files Cache and/or the TEMP files folder of ALL user profiles that are NOT in use when this command is executed. This utility was written for the purpose of allowing a SINGLE command to identify and clear Temporary Internet Files Cache and/ or TEMP files of ALL user profiles currently NOT in use.” [more]
Windows Compatible - 2000\XP\2003\Vista\2008\7
Citrix Compatible - Metaframe\Presentation Server\XenApp
Simply extract the zip file then run ICSweep from a command prompt with one of the following command line switches:
/ALL - Delete both Temporary Internet Files and Temp files
/TIF - Delete Temporary Internet Files only (Default)
/TMP - Delete Temp files only
/SIZE - Report the size of both Temporary Internet Files
and Temp files in each profile NOT in use. This
switch will also report the total size of
both Temporary Internet Files and Temp files NOT
in use. It DOES NOT DELETE any files.
Again, note that this is best done when all users are off of the server. On one of the servers I ran this utility on, it cleaned up 6 GB of space alone.