by Barry Dysert
(last updated October 9, 2017)
Robocopy is the tool to use when working with entire directories, since that's what it was designed to do. Let's say you want to "mirror" directories, i.e., make two directory trees contain identical files/folders. This is similar to using the /E switch (which is covered under the tip titled "Using Robocopy to Copy Entire Directories") along with the /PURGE switch. (The /PURGE switch tells Robocopy to delete destination files/folders that no longer exist in source.) The shorthand switch to mirror directories is /MIR, so the command to mirror directories is:
C:\> ROBOCOPY C:\Temp1 C:\Temp3 /MIR
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. In addition, if C:\Temp3 already existed, any files in its tree that are not in the C:\Temp1 tree will be deleted from the C:\Temp3 tree.
This tip (13197) applies to Windows 7, 8, and 10.
Windows Explorer has a good search utility built into it. As you use it, you may wish to delete a previously saved search ...Discover More
Robocopy is a robust file copy utility built into Windows. If you have a lot of file management to do that can't easily ...Discover More
If you ever want to copy user accounts, documents, pictures, etc., from one computer to another, you'll find that Windows ...Discover More
FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."