robocopy

Windows CMD · Files · available in the simulator

What it does

Robust file and directory copy; includes retry and mirroring capabilities.

Syntax

robocopy origen destino [archivo...] [opciones]

Options and parameters

  • /E

    Copies subdirectories, including empty ones.

    robocopy origen destino /E
  • /S

    Copies subdirectories, excluding empty ones.

  • /MIR

    Mirrors a directory tree: copies and deletes destination files/directories not in source.

    robocopy src dst /MIR
  • /MOV

    Moves files, deleting them from the source after copying.

  • /MOVE

    Moves files and directories, deleting them from the source after copying.

  • /PURGE

    Deletes destination files and directories that no longer exist in the source.

  • /COPY

    Specifies what file properties to copy: D Data, A Attributes, T Timestamps, S Security (NTFS ACL).

    robocopy src dst /COPY:DAT
  • /DCOPY

    Specifies what directory properties to copy: D Data, A Attributes, T Timestamps.

  • /SEC

    Copies files with security information; equivalent to /COPY:DATS.

  • /Z

    Copies files in restartable mode across network disconnects.

  • /B

    Copies files in backup mode using backup privileges.

  • /ZB

    Uses restartable mode; if access is denied, uses backup mode.

  • /R

    Specifies the number of retries on failed copies; default is 1,000,000.

    robocopy src dst /R:2
  • /W

    Specifies the wait time between retries, in seconds.

    robocopy src dst /R:2 /W:1
  • /MT

    Copies using multiple threads in parallel.

    robocopy src dst /MT:16
  • /MAX

    Excludes files larger than the specified size in bytes.

  • /MIN

    Excludes files smaller than the specified size in bytes.

  • /MAXAGE

    Excludes files older than the specified days or date.

  • /MINAGE

    Excludes files newer than the specified days or date.

  • /XF

    Excludes files matching the specified names or wildcards.

    robocopy src dst /E /XF *.tmp
  • /XD

    Excludes directories matching the specified names or paths.

    robocopy src dst /E /XD node_modules
  • /XJ

    Excludes junction points.

  • /LOG

    Writes the status output to the log file, overwriting the existing file.

    robocopy src dst /E /LOG:copia.log
  • /LOG+

    Appends the status output to the existing log file.

  • /TEE

    Writes the status output to the console window, as well as to the log file.

  • /NP

    Specifies that the percentage of copied files will not be displayed.

  • /NFL

    Specifies that file names are not to be logged.

  • /NDL

    Specifies that directory names are not to be logged.

  • /ETA

    Displays the estimated time of arrival of the copied files.

  • /FFT

    Uses FAT file times (two-second granularity).

  • /IPG

    Inter-packet gap in milliseconds, to free bandwidth on slow lines.

  • /J

    Copies using unbuffered I/O.

Usage examples

  • robocopy origen destino /E
  • robocopy src dst /MIR /R:2 /W:1
  • robocopy src dst /MIR
  • robocopy src dst /COPY:DAT
  • robocopy src dst /R:2
  • robocopy src dst /R:2 /W:1
  • robocopy src dst /MT:16
  • robocopy src dst /E /XF *.tmp
  • robocopy src dst /E /XD node_modules
  • robocopy src dst /E /LOG:copia.log
Practise robocopy

Related commands