Robocopy


Robocopy, or "Robust File Copy", is a command-line directory and/or file replication command for Microsoft Windows. Robocopy functionally replaces Xcopy, with more options. First released as part of the Windows NT 4.0 Resource Kit, it has been a standard feature of Windows since Windows Vista and Windows Server 2008. The command is robocopy.

Features

Robocopy is noted for capabilities above and beyond the built-in Windows copy and xcopy commands, including the following, some requiring appropriate command-line options:
Here are some examples of usage. If more than one option is specified, they must be separated by spaces.
If directory names have non-standard characters, such as spaces, they can be put in double quotes.
For the full reference, see the Microsoft TechNet Robocopy page.

Syntactic focus on copying folders

Robocopy syntax is markedly different from its predecessors, in that it accepts only folder names, without trailing backslash, as its source and destination arguments. File names and wildcard characters are not valid as source or destination arguments; files may be selected or excluded using the optional "file" filtering argument along with various other options.
For example, to copy two files from folder c:\bar to c:\baz, the following syntax is used:
robocopy c:\bar c:\baz file1.txt file2.db
And to copy all PDF files from c:\bar to c:\baz:
robocopy c:\bar c:\baz *.pdf
The files named are copied only from the folder selected for copying; fully qualified path names are not supported.

Output

Robocopy outputs to the screen, or optionally to a log file, all the directories it encounters, in alphabetical order. Each directory is preceded by the number of files in that directory that fulfill the criteria for being copied. If the directory does not yet exist in the target, it is marked "New Dir". But if the directory is empty and the /E option is not used, or it contains no files meeting the criteria, a new directory will not be created.
If the /NFL option is not used, the files being copied will be listed after the name of the directory they are in.
At the end of the output is a table giving numbers of directories, files, and bytes. For each of these, the table gives the total number found in the source, the number "copied", the number "skipped", and the number of "mismatches", "FAILED", and "extras". "Failed" can mean that there was an I/O error that prevented a file being copied, or that access was denied. There is also a row of time taken.

Bandwidth throttling

Robocopy's "inter-packet gap" option allows some control over the network bandwidth used in a session. In theory, the following formula expresses the delay required to simulate a desired bandwidth, over a network link with an available bandwidth of BA kbps:
In practice however, some experimentation is usually required to find a suitable delay, due to factors such as the nature and volume of other traffic on the network. The methodology employed by the IPG option may not offer the same level of control provided by some other bandwidth throttling technologies, such as BITS.

Limitations

Although Robocopy itself is a command-line tool, Microsoft TechNet provides a GUI front-end called Robocopy GUI. It was developed by Derk Benisch, a systems engineer with the MSN Search group at Microsoft, and required.NET Framework 2.0. It includes a copy of Robocopy version XP026.
There are other non-Microsoft GUIs for Robocopy:
Ken Tamaru of Microsoft has developed a copying program similar to Robocopy, called RichCopy, which is available on Microsoft TechNet. While it is not based on Robocopy, it offers similar features, and it does not require.NET Framework.

Versions

Several versions of Robocopy do not report the version number when executing robocopy /? on the command line. However, their version is stored inside the executable itself and can be queried with PowerShell for example or inside Windows Explorer by right-clicking on Robocopy.exe, selecting Properties, then clicking on the Details tab.
Product versionFile versionYearOriginOther
1.54-1996Windows NT 4.0 Resource Kit© 1996
1.70-1997Windows NT Resource Kit
1.714.0.1.711997Windows NT Resource Kit
1.954.0.1.951999Windows 2000 Resource Kit
1.964.0.1.961999Windows 2000 Resource Kit© 1995-1997
XP0105.1.1.10102003Windows 2003 Resource Kit
XP0265.1.2600.262005Downloaded with Robocopy GUI v.3.1.2; /DCOPY:T option introduced
XP0275.1.10.10272008Bundled with Windows Vista, Server 2008, Windows 7, Server 2008r2© 1995-2004
6.16.1.76012009© 2009
6.26.2.92002012Bundled with Windows 8© 2012
6.36.3.96002013Bundled with Windows 8.1© 2013
10.010.0.10240.163842015Bundled with Windows 10© 2015
10.0.1629910.0.16299.152017Bundled with Windows 10 1709© 2017
10.0.1713410.0.17134.12018Bundled with Windows 10 1803© 2018
10.0.1776310.0.17763.12018Bundled with Windows 10 1809© 2018
10.0.1836210.0.18362.12019Bundled with Windows 10 1903© 2019