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.
You may wish to clear your Recently Used Documents list or even have them not remembered in the first place. How you ...Discover More
Every file on your disk drive has a unique file path that defines its location. Understanding how file paths work can be ...Discover More
Need to know how much disk space is consumed by the small applications (apps) installed on your system? Windows makes it ...Discover More