Using Robocopy to Copy Entire Directories

by Barry Dysert
(last updated October 2, 2017)

10

Robocopy is the tool to use when working with entire directories, since that's what it was designed to do. If you only want to copy a directory (and its included files) to another directory, you can use the basic syntax for Robocopy, and you need not specify any options. So let's say you have a directory tree that looks like this:

C:\Temp1\Temp2

The Temp1 directory contains a file named T1.tmp. The Temp1\Temp2 directory contains a file named T1T2.tmp.

Now, let's say you want to copy the Temp1 directory (and its files) to a new directory called C:\Temp3. The command to do this is:

ROBOCOPY C:\Temp1 C:\Temp3

Robocopy creates the C:\Temp3 directory and copies the files from the C:\Temp1 directory into it. If you want to copy the entire directory tree under C:\Temp1 you just need to add the /E switch to the command:

ROBOCOPY C:\Temp1 C:\Temp3 /E

This results in the creation of C:\Temp3, and all of the files and folders under C:\Temp1 will be copied to the newly built tree under C:\Temp3.

 This tip (13188) applies to Windows 7, 8, and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...

MORE FROM BARRY

How to Change Drive Letters

Windows is quite configurable. It even allows you to change the drive letters associated with your disk drives. Although ...

Discover More

Creating and Using Compressed Folders

If you're low on disk space but still want to keep your files online, you might consider moving them to compressed ...

Discover More

Understanding Jump Lists

Jump lists are great productivity enhancers to Windows 7. By using jump lists, you can easily access frequently used ...

Discover More
More WindowsTips

Creating a System Repair Disk on a USB Flash Drive

Having a system repair disk is almost as important as doing regular backups. CDs and DVDs, though, tend to get scratched ...

Discover More

Copying Data with XCopy

XCopy is a file and directory copy utility built into Windows. If you have a lot of file management to do that can't ...

Discover More

Creating a System Image

A system image is a snapshot of your system disk as of a certain point in time. Should the need arise, you can restore ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 5 + 3?

2018-06-04 06:36:58

Vowner

But using robocopy i am not able to copy the mlinks folder content


2017-11-07 10:24:23

catherine lee

Well, using robocopy for copying entire file directroy and file sync does not sound good to me. Because its transfer speed is not good enough to transfer million of files. I am now using GS Richcopy 360 instead and I found it way better than robo. Plus it has a clean GUI so no need to remember the commands, what else would someone want. Cheers!


2017-10-19 19:30:08

Barry

I honestly have no idea. Of course you could try it out simply by opening a second command window and kick off both of your copies in different windows. I'd be curious to know the outcome.


2017-10-19 18:31:43

Questorfla

I was wondering whether there was a way to handle multiple copy routines at once and if so would it save any time or use less resources?\

For example: I have a need to copy (C:\A\*.* to D:\A\) AND (C:\A\*.* to E:\A\) making two identical sets of backups.
I currently do this by running the first one (C to D) then running the 2nd one (C to E).

Is there a way to run (C: to D: & E:) at the same time? And would it be any faster or more efficient to do so?


2017-10-02 15:20:01

Ted Duke

Is Robocopy more efficient than opening two File Explorer windows, selecting files or folders from one location and moving or copying the selected items to another location? That is not at all difficult to do, visually shows what is being processed, and would likely be easier than command-language for most users of Windows.


2017-10-02 12:48:14

Allen

Brian, see here:

https://windows.tips.net/T013186_Understanding_Robocopy.html

Note, as well, that you can type "RoboCopy" (without quote marks) into the search box at the upper-right of this page and find lots of tips related to the utility.

-Allen


2017-10-02 12:32:14

Brian Hershman

I am feeling amnesiac and rather stupid.... But how and where do you enter the Robocopy command?


2017-10-02 11:30:52

David H.

Tom: Here's a link from lifewire for displaying the command prompt for various Operating Systems.
https://www.lifewire.com/how-to-open-command-prompt-2618089


2017-10-02 07:18:06

Barry

You invoke Robocopy from a command prompt. If you don't know how to get to a command prompt, that's discussed in another tip here somewhere.


2017-10-02 06:48:29

Tom

I understand that RoboCopy comes on windows but I don't see it on my machine to give it a try. Even trying to search Microsoft is rather confusing.


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.