I came across this utility from the folks over at Ctrl-Alt-Del Consulting which is great for reclaiming space taken by users temporary internet files stacking up over time. I’ve found it especially helpful on terminal servers with hundreds of users. Download their free tool ICSweep here:
Once downloaded, extract it to the root of C:\. Open an administrative command prompt and cd to the “C:\ICSweep” directory and reference the following switches:
ICSweep [/ALL|/TIF|/TMP] [/?]
/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.
/? - show this help file
Robocopy is a great tool, but there are so many options/attributes to choose from, a simple copy script for a server migration can take more time than you’d care to spend. I typically create and run these commands from the new/destination server. Below are the quick steps you can use on a new server to:
- Copy all files/folders, retaining their timestamps, from source server to destination server
- Log the outcome of the copy job so that you can kick it off, let it run, and check back later for any files that may have had issues
- Modify your copy job to only capture only incremental file/folder changes after your initial large file copy
FULL COPY (with log):
robocopy “SOURCE” “DESTINATION” /NP /TEE /MT:32 /E /R:3 /W:5 /ZB /COPY:DT /LOG:”LOG_FILE_NAME_&_LOCATION”
robocopy “\\Source_Server\Data_Share” “D:\Data_Share” /NP /TEE /MT:32 /E /R:3 /W:5 /ZB /COPY:DT /LOG:”C:\Users\administrator\Desktop\data_share_log.txt”
MIRROR/INCREMENTAL COPY (/MIR):
robocopy “SOURCE” “DESTINATION” /NP /TEE /MT:32 /E /R:3 /W:5 /ZB /MIR /COPY:DT /LOG:”LOG_FILE_NAME_&_LOCATION”
robocopy “\\Source_Server\Data_Share” “D:\Data_Share” /NP /TEE /MT:32 /E /R:3 /W:5 /ZB /MIR /COPY:DT /LOG:”C:\Users\administrator\Desktop\data_share_log.txt”
The two commands/examples above are identical minus one attribute, /MIR. Typically, I use the first example to do the initial large copy. Let it run all night, and then check the log file on the desktop the following morning searching for the word ‘error’. If you have to postpone your ‘new server cutover date’, the second example comes in handy. It will only copy files from the source destination that are new or newer than what already is in the destination. It’s much more efficient than redoing the entire copy job, and very helpful for keeping the new directory up and in-sync with the source.
The full list of available robocopy attributes is available here. The quick reference for the ones in my example are here:
/NP – Specifies that the progress of the copying operation (the number of files or directories copied so far) will not be displayed.
/TEE – Writes the status output to the console window, as well as to the log file.
/MT:<N> – Creates multi-threaded copies with N threads. N must be an integer between 1 and 128. The default value for N is 8.
/E – Copies subdirectories. Note that this option includes empty directories.
/R:<N> – Specifies the number of retries on failed copies. The default value of N is 1,000,000 (one million retries).
/W:<N> – Specifies the wait time between retries, in seconds. The default value of N is 30 (wait time 30 seconds).
/ZB – Uses Restart mode. If access is denied, this option uses Backup mode.
/MIR – Mirrors a directory tree (equivalent to /e plus /purge).
/COPY:DT – Specifies the file properties to be copied. (D=Data, T=Timestamp)
/LOG:<LogFile> – Writes the status output to the log file (overwrites the existing log file).
Many times on a Windows Server or PC you will have had multiple users log in at some point in time, and each user account has it’s own Recycling Bin. When getting cramped for free space, it can be handy to empty all Recycling Bin’s at one time, so you do have to, or can’t log into the other accounts:
Windows7, Server2008/R2, Server2012/R2
rd /s c:\$Recycle.Bin
WindowsXP, Vista, Server2003/R2
rd /s c:\recycler