Home > Commands N-Z > Commands R

ROBOCOPY


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Robust File and Folder Copy.


Syntax

ROBOCOPY source_folder destination_folder [file(s)_to_copy] [[/E] | [/S]] [[/A] | [/M]] [/L] [/A-:[R][A][S][H]] [/A+:[R][A][S][H]] [/ETA] [/IS] [/MOVE] [/PURGE] [/R:n] [/T:n] [/V:n] [/W:n] [/X] [/REG] [/XA:[R][A][S][H]] [/XC | /XN | /XO] [/XL | /XX] [/XF file [file...]] [/XD dir [dir...]]


Parameters
destination_folder (NT4)
Destination folder.
file(s)_to_copy (NT4)
A list of files or a wildcard. If no source "file(s)_to_copy" are specified, default to *.*.
source_folder (NT4)
Source folder.

Switches
/A (NT4)
Copy only files with the Archive attribute set.
/A-:[R][A][S][H] (NT4)
Set file Attributes on destination files - remove.
/A+:[R][A][S][H] (NT4)
Set file Attributes on destination files - add.
/E (NT4)
Copy Subfolders, including Empty Subfolders.
/ETA (NT4)
Show Estimated Time of Arrival of copied files.
/IS (NT4)
Include in the report files that did not need updating (already the Same).
/L (NT4)
List only - don't copy, timestamp or delete any files.
/M (NT4)
Like /A, but remove Archive attribute from source files.
/MOVE (NT4)
Move files and dirs (delete from source after copying).
/PURGE (NT4)
Delete destination files/folders that no longer exist in source.
/R:n (NT4)
Number (n) of Retries on failed copies - default is 1 million.
/REG (NT4)
Save /R:n and /W:n in the Registry as default settings.
/S (NT4)
Copy Subfolders.
/T (NT4)
Timestamp all destination files, including skipped files.
/V (NT4)
Produce Verbose output, showing skipped files.
/W:n (NT4)
Wait time (n) between retries - default is 30 seconds.
/X (NT4)
Report all eXtra files, not just those selected & copied.
/XA:[R][A][S][H] (NT4)
eXclude files with any of the given Attributes.
/XC (NT4)
eXclude Changed files.
/XD dir [dir...] (NT4)
eXclude Directories matching given names/paths.
/XF file [file...] (NT4)
eXclude Files matching given names/paths/wildcards.
/XL (NT4)
eXclude Lonely files and dirs. A "lonely" file is present in source but not destination excluding lonely will prevent any new files being added to the destination.
/XN (NT4)
eXclude Newer files.
/XO (NT4)
eXclude Older files.
/XX (NT4)
eXclude eXtra files and dirs. An "extra" file is present in destination but not source, excluding extras will delete from destination.

Related

COPY - Copy one or more files to another location.
SCOPY - Copy complete with NTFS Security Permissions.
XCOPY - Copy files and folders.
Equivalent Linux BASH commands:
remsync - Synchronize remote files.
cp - Copy one or more files to another location.


Notes

ROBOCOPY will accept UNC pathnames.


Examples

none.


Errorlevels

none.


Availability
External Resource Kit
DOS
none
Windows
none
Windows NT
NT4