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).
Windows 7 is great, and overall, the Offline Files work much better than in XP, but they removed the easy ability to clear/reinitialize the Offline File cache with a simple “Ctrl+Shift + Delete Files”. It is now more a bit more involved.
I just finished migrating a customer to a new server that had people’s My Documents redirected to it, and even though on the user’s workstations, the path was updated correctly to the new server’s share, when I drilled down into the users Sync Center settings to see what was in the cache, the old server was there, unable to be deleted, essentially greyed out and orphaned. Doing the following although, somewhat of a pain, worked for me:
1) Click Start > Run
2) Enter the following and click OK:
REG ADD "HKLM\System\CurrentControlSet\Services\CSC\Parameters" /v FormatDatabase /t REG_DWORD /d 1 /f
3) Reboot the PC
4) Log in, locate the folder that should be available offline, right-click, ‘Make Available Offline’
5) Grab a beer.