Features
Robocopy is noted for capabilities above and beyond the built-in Windows/XJ
)
*Ability to copy file data and attributes correctly, and to preserve original timestamps, as well as NTFS ACLs, owner information, and audit information using the /COPYALL
or /COPY:
/DCOPY:T
), even with the ability to update folder timestamps (copied from existing folders) on folders already created from previous versions (that did not copy the folder date and timestamps).
*Ability to assert the /B
) so an administrator may copy an entire directory, including files denied readability to the administrator.
*Persistence by default, with a programmable number of automatic retries if a file cannot be copied.
*A "mirror" mode, which keeps trees synchronised by also deleting files in the destination that are not present in the source.
*Ability to skip files already in the destination folder with identical size and timestamp.
*A continuously updated command-line progress indicator.
*Ability to copy paths exceeding 259 characters — up to a theoretical limit of about 32,000 characters — without errors.
*Multithreaded copying introduced with Compression
Since Windows Server 2019 and Windows 10, acompression
option is available in robocopy
when copying across a network. With this switch, if the destination computer supports SMB compression and the files being copied are very compressible, there may be significant improvements to performance. The SMB compression adds inline whitespace compression to file transfers. Compression is also available with the xcopy
In computing, XCOPY is a command used on IBM PC DOS, MS-DOS, IBM OS/2, Microsoft Windows, FreeDOS, ReactOS, and related operating systems for copying multiple files or entire directory trees from one directory to another and for copying files a ...
command and Examples of use
Here are some examples of usage, which is not case-sensitive. If more than one option is specified, they must be separated by spaces. * Copy directory contents of the source to the destination (including file data, attributes and timestamps), recursively with empty directories (/E
):
:Robocopy "C:\Directory A" "C:\Directory B" /E
If directory names have non-standard characters, such as spaces, they must be enclosed in double quotes, as is usual in the command line.
* Copy directory /E
), copy all file information (/COPYALL
, equivalent to /COPY:DATSOU
, D
=Data, A
=Attributes, T
=Timestamps, S
=Security=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:\A C:\B /COPYALL /E /R:0 /DCOPY:T
* Mirror A to B, destroying any files in B that are not present in A (/MIR
), copy files in resume mode (/Z
) in case network connection is lost:
:Robocopy C:\A \\backupserver\B /MIR /Z
For the full reference, see the Microsoft TechNet Robocopy page.
Syntactic focus on copying folders
Robocopy syntax is markedly different from its predecessors (*
and ?
) are not valid as source or destination arguments; files may be selected or excluded using the optional "file" filtering argument (which supports wildcards) 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.
CAUTION: A long-standing issue with Robocopy means that if you back up from the root folder of a drive e.g., the destination files will be given attributes including SH. This means that they will be invisible to normal access (including DIR in cmd.exe). To fix this, add to the robocopy command line - or do an ATTRIB command to remove them afterwards.
Output
Robocopy outputs to the screen, or optionally to a log file, the names of all the directories it encounters, in alphabetical order. Each name is preceded by the number of files in the directory that fulfill the criteria for being copied. If the directory does not yet exist in the target, it is marked "New Dir"; 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 (no file names in log) 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'' (including directories marked "New Dir" even if they are not copied), the number ''skipped'' (because they already exist in the target), 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 (in which the time spent on failed files seems to be in the wrong column).Bandwidth throttling
Robocopy's " inter-packet gap" (IPG) option allows some control over the network bandwidth used in a session. In theory, the following formula expresses the delay (, in milliseconds) required to simulate a desired bandwidth (BD, inLimitations
* Robocopy does not copy open files. Any process may open files for exclusive read access by withholding theFILE_SHARE_READ
flag during opening. Even Robocopy's ''Backup mode'' will not touch those files. (''Backup mode'' instead runs Robocopy as a "Backup Operator". This allows Robocopy to override permissions settings, specifically, NTFS ACLs). Normally /MT n/code> option to enable multithreaded copying, the /NP
option to disable reporting of the progress percentage for files is ignored. By default the MT switch provides 8 threads. The n is the number of threads you specify if you do not want to use the default.
GUI
Although Robocopy itself is a command-line tool, Microsoft TechNet
Microsoft TechNet was a Microsoft web portal and web service for IT professionals. It included a library containing documentation and technical resources for Microsoft products, a learning center which provides online training, discussion forum ...
provided a GUI
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
front-end called Robocopy GUI. It was developed by Derk Benisch, a systems engineer with the MSN Search
Microsoft Bing (commonly known as Bing) is a web search engine owned and operated by Microsoft. The service has its origins in Microsoft's previous search engines: MSN Search, Windows Live Search and later Live Search. Bing provides a variety ...
group at Microsoft, and required .NET Framework
The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
2.0. It included a copy of Robocopy version XP026. It is no longer available from Microsoft, but may be downloaded from the Internet Archive
The Internet Archive is an American digital library with the stated mission of "universal access to all knowledge". It provides free public access to collections of digitized materials, including websites, software applications/games, music ...
's Wayback Machine
The Wayback Machine is a digital archive of the World Wide Web founded by the Internet Archive, a nonprofit based in San Francisco, California. Created in 1996 and launched to the public in 2001, it allows the user to go "back in time" and s ...
.
There are non-Microsoft GUIs for Robocopy:
* Cinchoo's ChoEazyCopy, Simple and powerful RoboCopy GUI v2.0.0.1 (March 11, 2022)
* "Easy RoboCopy", latest version 1.0.16 released on January 11, 2022.
* "WinRoboCopy" revision 1.3.5953.40896 released on April 19, 2016.
* RoboCop RoboCopy, Robocopy GUI Skin and script generator with Progress Monitoring, 10 September 2015.
* A program by SH-Soft, also called "Robocopy GUI" v1.0.0.24 (October 8, 2005).
Ken Tamaru of Microsoft developed a copying program with functionality similar to Robocopy, called RichCopy
RichCopy is a file copy utility program developed by Ken Tamaru of Microsoft Corporation, discontinued in 2010. It is multi-threaded, which permits it under some circumstances to copy files faster than some other copiers available for the Windows ...
, discontinued in 2010. It is not based on Robocopy, and 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 (gcm robocopy , fl *
) or inside Windows Explorer by right-clicking on Robocopy.exe, selecting Properties, then clicking on the Details tab.
See also
* List of file copying software
This article provides a list of inbuilt and third party file copying and moving software - utilities and other software used, as part of computer file management, to explicitly move and copy files and other data on demand from one location to a ...
* Command line
** List of DOS commands
This article presents a list of commands used by DOS operating systems, especially as used on x86-based IBM PC compatibles (PCs). Other DOS operating systems are not part of the scope of this list.
In DOS, many standard system commands were p ...
** rsync
rsync is a utility for efficiently transferring and synchronizing files between a computer and a storage drive and across networked computers by comparing the modification times and sizes of files. It is commonly found on Unix-like operatin ...
* GUI
** SyncToy
SyncToy was a freeware tool in Microsoft's PowerToys series that provided an easy-to-use graphical user interface for synchronizing files and folders in Windows versions XP, Vista, 7 and 10. It was written using Microsoft's .NET Framework and use ...
** Ultracopier
Ultracopier is file-copying software for Windows, macOS, and Linux. It supersedes ''SuperCopier''.
Features
Main features include:
*pause/resume transfers
*dynamic speed limitation
*on-error resume
*error/collision management
*data security
* ...
References
External links
* Official sources
*
Microsoft Robocopy documentation
Robocopy download
(Version XP010) as part of Windows Server 2003 Resource Kit Tools. Includes 35-page documentation "robocopy.doc".
Robocopy short documentation
on Microsoft TechNet Library
Robocopy GUI download
(Version 3.1.2.0) on Microsoft TechNet Magazine
* Other
{{Windows commands
File copy utilities