Skip to content

Dear Internet Explorer user: Your browser is no longer supported

Please switch to a modern browser such as Microsoft Edge, Mozilla Firefox or Google Chrome to view this website's content.

Robocopy

Use the built-in Microsoft “robocopy” utility to move or copy files en masse.

Moving files between folders using the Windows Explorer may be convenient for small tasks, but there is a much better way to manage bulk tasks. Robocopy (Robust File Copy) is a command-line file copying tool included in Windows operating system that will run through MS-DOS or PowerShell.

Robocopy is designed for reliable copy or mirroring of entire folders of any size. In the copying process, robocopy will ensure that all NTFS ACLS, attributes, owner information, alternate data streams, auditing information, timestamps and properties are copied except security information unless explicitly requested with /COPYALL switch. The convenience of a graphical user interface is swapped for a much more powerful utility.

Robocopy Syntax

The format for robocopy commands is: robocopy source destination [file [file]...] [options]

A comprehensive list of commands is available on the MSDN website.

To use robocopy, open a command line prompt (either MS-DOS or PowerShell) and enter a command.

Copy all files

To copy all contents including empty directories of the source folder:

robocopy C:\path\to\source C:\path\to\destination

Move all files

To move all contents including empty directories of the source folder:

robocopy C:\path\to\source C:\path\to\destination /e /move

To move all contents excluding empty directories of the source folder:

robocopy C:\path\to\source C:\path\to\destination /s /move

Copy files of a certain type

To copy all contents with a .jpg extension including empty directories of the source folder:

robocopy C:\path\to\source C:\path\to\destination *.jpg

Copy files of a certain size

To copy files larger than 32 MB (33553332 bytes) in size:

robocopy C:\path\to\source C:\path\to\destination /min:33553332

To copy files larger than 32 MB(33553332 bytes) in size:

robocopy C:\path\to\source C:\path\to\destination /max:33553332

Mirror directories

The following command will mirror the directories using Robocopy:

robocopy C:\path\to\source C:\path\to\destination /MIR /FFT /Z /XA:H /W:5

   

Comments

No comments have yet been submitted. Be the first!

Have Your Say

The following HTML is permitted:
<a href="" title=""> <b> <blockquote cite=""> <code> <em> <i> <q cite=""> <strike> <strong>

Comments will be published subject to the Editorial Policy.