In all versions of Windows 7 there is a little known but easy to use utility bundled in called Robocopy. Why would you want to use Robocopy over just dragging and dropping or copying and pasting files and folders over manually? Here are some reasons why you might want to add Robocopy to your toolbox of useful utilities:
- Robocopy is MUCH faster at copying a large number of files from one location to another compared to the built in Windows copy.
- Robocopy can intelligently "Backup" (Mirror) a large number of files.
- Robocopy can delete a large number of files efficiently as well.
About COPYING:
Why is Robocopy much faster at copying files than the built in Windows copy? Robocopy supports what is called Multi-Threading. In other words, think of Robocopy as a team of workers moving rocks from one pile to another where as Windows is a single worker moving rocks. When Windows copies or moves files over, it performs this task one file at a time. If there is a large file that Windows is moving over, it will spend ALL of its TIME moving just that ONE file despite the fact that there might be 100 smaller files that could be moved quickly. What Robocopy does is attempt to copy or move 8 files (By default) at the same, so if 1 file is taking a long time, 7 other files can be copied and moved independently. This results in a significant decrease in the time it takes to copy or move a large number of files when using Robocopy.
About BACKING UP (MIrroring):
Robocopy can also be used to perform simple one to one backups of files; subsequent backups to the same location will be MUCH faster. Robocopy can be easily configured to check which files and folders exist in the destination (copy to) location that exist (or don't exist anymore) from the source (copy from) location. Robocopy will skip copying these files if they already exist, add files if they don't exist, and delete files from the destination (copy to) location resulting in FAST simple backups! Awesome!
About DELETING:
As with copying, Robocopy can be used to delete a large number of files quickly and efficiently too. Although Robocopy isn't designed to do this, there is a simple trick that can be used to do this as well. Same principle applies - Multi-Threaded which allows Robocopy to delete multiple files at a time instead of one at a time.
using robocopy to copy, backup, delete files:
So now that you know some basics about Robocopy, lets examine some useful commands and SEE HOW we can use this!
- Open the Command Prompt. This can be done by opening up the Start Menu and typing 'cmd' into the "Search Programs and Files" text box. It will be called "cmd.exe" with a black icon.
- You'll get a black windows with C:\WINDOWS\system32\cmd.exe written across the top bar. Now you're ready to start using Robocopy!


Copying all files and folders from one location to another location:
Type: "robocopy {source location} {destination location} /E"
Example: robocopy C:\exampleSourceFolder1\exampleSourceFolder2 D:\exampleDestinationFolder1 /E
Note: This will copy "exampleSourceFolder2" including all files and folders inside to "exampleDestionationFolde1". The "/E" on the end tells Robocopy to copy everything.
Backing up all files and folders from one location to another location (Making an exact copy of the source location at the destination location):
Type: "robocopy {source location} {destination location} /E /MIR"
Example: robocopy C:\exampleSourceFolder1\exampleSourceFolder2 D:\exampleBackupDestinationFolder1 /E /MIR
Note: This will copy "exampleSourceFolder2" including all files and folders inside to "exampleBackupDestinationFolder1". Files that exist in exampleSourceFolder2 that DO NOT EXIST at the same location inside exampleBackupDestinationFolder1, will be created at the destination location. Files that EXIST in the destination location that DO NOT EXIST in the source location WILL BE DELETED! Files that EXIST in exampleSourceFolder2 that EXIST in exampleBackupDestinationFolder1 THAT ARE EXACTLY THE SAME will be SKIPPED (Much faster on subsequent backups to the same location!). Files that EXIST and are NEWER in the sourceFolder2 than the files that EXIST and are OLDER in the exampleBackupDestionationFolder1 location will be REPLACED! Robocopy will make an exact copy (Clone) of the source folder to the destination folder. So be careful that you're not replacing or deleting files in your backup location that aren't in your source location. As a simple backup that creates a clone, Robocopy is fast and easy to use.
Deleting a large number of files and folders quickly:
Create an empty folder; for example, C:\MyNewEmptyFolder
Type: "robocopy {empty folder location} {location folder to delete} /E /MIR"
Example: robocopy C:\MyNewEmptyFolder C:\folder1\folder1\MyFolderWIthThousandsOfFiles /E / MIR
Note: Because Robocopy will make the destination folder an exact copy of the source folder, if the source folder is empty, Robocopy will empty the destination folder (including all files and folders inside).
There are lots of ways to tweak Robocopy to do things like copying only a specific file type or to ignore files that are in use or locked. Here are some additional "flags" that you can put at the end of your Robocopy command:
Control the number of retries: /R:n Where 'n' is a number (e.g. 1 or 27) of times to retry to copy a file
Control the length of time to wait before retrying again: /W:n Where 'n' is a number (1 or 300) representing the number of seconds to wait before retrying.
Stop Robocopy from getting stuck in a loop: /XJ
Control the number of "workers" or Threads that Robocopy will try to use: /MT:n Where 'n' is a number between 1 and 128
For a list of additional commands, type into the Command Prompt: robocopy /?





