Robocopy is a robust file copy command for the Windows command line. It allows users to copy files, directories, and drives from one location to another.

Availability

Robocopy is an external command available for the following Microsoft operating systems as robocopy.exe.

  • Availability

  • Robocopy syntax

  • Robocopy examples

  • Windows NT (In resource kit)

  • Windows 2000 (In resource kit)

  • Windows Server 2008

  • Windows Vista

  • Windows 7

  • Windows 8

  • Windows 10

  • Windows 11

Robocopy syntax

Windows 10 and 11 syntax

ROBOCOPY source destination [file [file]…] [options]

Copy options

  • Windows 10 and 11 syntax.
  • Windows 8 and earlier syntax.

Copy File Throttling options

File Selection options

The Copy File Throttling options are only available in Windows 11.

Retry options

Logging options

Job options

Remarks

Using /PURGE or /MIR on the root directory of the volume formerly caused robocopy to apply the requested operation on files inside the System Volume Information directory as well. That is no longer the case. If /PURGE or /MIR is specified, robocopy skips any files or directories with that name in top-level source and destination directories of the copy session.

The modified files classification applies only when source and destination filesystems support change timestamps (e.g., NTFS), and the source and destination files have different change times. These files are not copied by default; specify /IM to include them.

The /DCOPY:E flag requests that extended attribute copying should be attempted for directories. Note that currently robocopy continues if a directory’s EAs could not be copied. This flag is also not included in /COPYALL.

Using /LFSM requests robocopy to operate in ’low free space mode’. In that mode, robocopy pauses whenever file copying would cause the destination volume’s free space to go below a ‘floor’ value, which can be explicitly specified by the LFSM:n[KMG] form of the flag. If /LFSM is specified with no explicit floor value, the floor is set to ten percent of the destination volume’s size. Low free space mode is incompatible with /MT, /EFSRAW, /B, and /ZB.

Windows 8 and earlier syntax

Robocopy examples

robocopy c:\hope c:\hope2 *.txt

In this first example, any .txt file would be copied from the hope directory into the hope2 directory. Whenever you want to copy one or more files and not a complete directory the file must be specified after the destination directory.

robocopy c:\hope c:\hope2

In the above example, the robocopy command would copy all files (not directories) in the hope directory to the hope2 directory.

robocopy c:\hope c:\hope2 /e

In the above example, all files and folders (including empty ones) are copied from the hope directory to the hope2 directory.

robocopy c:\hope c:\hope2 /MIR

This example mirrors what’s in c:\hope into c:\hope2 and purge any files in the hope2 directory that don’t exist in the hope directory. Use the /mir switch cautiously since it is deleting files that do not match in the destination directory.

robocopy \computer\hope C:\hope2

Next, this example would copy any of the files in the hope directory on the network computer named computer to the current computer hope2 directory.

  • How to copy, move, or rename files with a space in the name.
  • See our copy definition for further information and related links on this term.