Thursday, January 24, 2013

Robocopy


Copies all files and folders from the source location to the destination location.
Robocopy <PathToSourceFolderLevel> <PathToSourceFolderDestination> /E

/E and subfolders inc empty ones

/Z copies files in restartable mode (if there is a network interruption the job can restart midway through the file it was copying previously - useful for large files.)

/LOG:<PathToLogFile>

BE CAREFUL WITH THE /MIR OPTION IT CAN PERMANENTLY DELETE FILES ON THE DESTINATION.

Make sure the log file is specified to land in a writable location by the process running it!  users, system etc.

A command similar to this may be useful for making a copy or back up of a user profile.
It would need to be running elevated as an admin but you get the idea.


md %userprofile%bak
robocopy %userprofile% %userprofile%bak /xj /purge /s /R:0 /XD %temp% /XF *.tmp /TEE /NFL /NDL /LOG:%userprofile%BAK\robolog