Robocopy: Robust File Copy

Robocopy, or “Robust File Copy”, is a command-line directory replication command. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was introduced as a standard feature of Windows Vista, Windows 7 and Windows Server 2008. The command is robocopy.

If your operating system does not installed with the robocopy, you can download and install it via this link.

Option

ROBOCOPY Source_folder Destination_folder [options]

Execute Robocopy /? for full dialog help.

Example

1. Copy directory contents of ​MyFolder​ to ​YourFolder​ (including file data, attributes and timestamps), recursively with empty directories (/E):

Robocopy C:\MyFolder C:\YourFolder /E

2. Copy directory recursively (/E), and copy all file information (/COPYALL, equivalent to /COPY:DATSOU, D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info, U=aUditing info), do not retry locked files (/R:0)(the number of retries on failed copies default value is 1 million), preserve original directories’ Timestamps (/DCOPY:T – requires version XP026 or later):

Robocopy C:\MyFolder C:\YourFolder /COPYALL /E /R:0 /DCOPY:T

3. Mirror MyFolder to YourFolder, destroying any files in YourFolder that are not present in MyFolder (/MIR), copy files in restartable mode (/Z) in case network connection is lost:

Robocopy C:\MyFolder \\networkserver\YourFolder /MIR /Z

You May Also Like

Leave a Reply?