RoboCopy Windows 10 – Robocopy (Robust File Copy) is a command-line tool built into Windows 10, but it’s been around for years, and it’s a powerful and flexible tool to migrate files extremely fast.
When you finished to install Windows 10, you may still need to transfer all your files to the new device. Usually, you just use an external hard drive to copy your files and move it over the new device. Or if you’re a tech-savvy user, you probably transfer the files over the network to the new PC setting up file share.
While these are all good options, depending on the amount of data you need to transfer, using File Explorer, the process can take a very long time. If you want to copy (migrate) a lot of files faster and more reliably, you need a better solution, such as Robocopy.
In this guide, you’ll learn the steps to use RoboCopy on Windows 10 to quickly transfer a lot of files over the network.
Robocopy is a command line utility for copying files. This command is available in Vista and Windows 7 by default. For Windows XP and Server 2003 this tool can be downloaded as part of Server 2003 Windows Resource Kit tools. This package is available in the below location.
How to use Robocopy to copy files over the network fast
The features included with RoboCopy allows you to copy files very quickly, but remember that you’ll need a wired connection for the best experience. The time that will take to complete the transfer will depend on the network connection speed and disks performance.
This is a two-step process. You must first configure file sharing on the source device, and then use Robocopy in the destination device to perform the transfer.
Step 1: Configuring file sharing on Windows 10
In order to copy files between two computers, you must enable file sharing in the source device, so that Robocopy can access and copy the files from the destination device.
To share files on your local network using the express settings, use these steps:
- Open File Explorer.
- Navigate to the folder you want to share.
- Right-click the item, and select Properties.
- On the “Properties” window, click the Sharing tab.
- Click the Share button.
- Use the drop-down menu to select the user or group to share file or folder. For the purpose of this guide, select the Everyone group.
- Click the Add button.
- Under “Permission Level,” select the type of sharing permissions you want the folder to have. For example, you can select Read (default) if you only want users to be able to view and open files. If you select Read/Write, users can view, open, modify, and delete the content on the folder you’re sharing.
- Click the Share button.
- Note the network path for the folder that other users will need to access the content over the network and click the Done button.
- Click the Close button.
After completing the steps, make note to of the folder path and the IP address of your source computer.
Step 2: Using Robocopy to quickly copy a lot of files on Windows 10
Once file sharing is configured on the source device, you can proceed copying the files using Robocopy from the destination device.
To use Robocopy to copy files fast on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the result, and select Run as administrator.
- Type the following command to copy the files over the network and press Enter:
robocopy \\source-device-ip\path\to\share\folder C:\destination-device\path\to\store\files /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
robocopy \\10.1.2.111\Users\admin\Documents C:\Users\admin\Documents /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
In the above command make sure to change the source and destination paths with your configuration.
Robocopy Command Syntax
Robocopy has a lot of features that you can use, in the command shown in this guide, we’re using the following switches to make copy reliable and fast.
- /S — Copy subdirectories, but not empty ones.
- /E — Copy Subdirectories, including empty ones.
- /Z — Copy files in restartable mode.
- /ZB — Uses restartable mode, if access denied use backup mode.
- /R:5 — Retry 5 times (you can specify a different number, default is 1 million).
- /W:5 — Wait 5 seconds before retrying (you can specify a different number, default is 30 seconds).
- /TBD — Wait for sharenames To Be Defined (retry error 67).
- /NP — No Progress – don’t display percentage copied.
- /V — Produce verbose output, showing skipped files.
- /MT:16 — Do multi-threaded copies with n threads (default is 8).
Perhaps the most important switch to pay attention is /MT, which is a feature that enables Robocopy to copy files in multi-threaded mode. Typically, when you copy files using File Explorer, you’re only copying one file at a time, but with multi-threaded enabled, you can copy multiple files at the same time better utilizing the bandwidth and significantly speeding up the process.
If you don’t set a number when using the /MT switch, then the default number will be 8, which means that Robocopy will try to copy eight files at the same time. However, Robocopy supports 1 to 128 threads.
In the command shown in this guide, we’re using 16, but you can set it to a higher number. The only caveat is that the greater the number, the more processing power and bandwidth will be utilized. If you have an older processor and a not reliable network connection, it could mean trouble, as such make sure to test before executing the command with a high number of threads.
You can always view all the available switches, simply run the
robocopy /? command. If you have any problems, you can submit your questions to the Pureinfotech forums.
Robocopy command is used on Windows to copy files and directories from one location to another. This CMD command also prints a detailed report of the copy operation. Below you can find examples for using Robocopy in various usecases.
Copy a directory
Example: Copy all the files in the directory D:\dir1\data to E:\backup\data. Don’t include sub directories or the files stored in those.
Robocopy D:\dir1\data E:\backup\data
The above command copies system files and hidden files too. Copy and Xcopy commands skip these files by default.
At the end of the command execution, it would print the summary like below.
Total Copied Skipped Mismatch FAILED Extras Dirs : 22 22 0 0 0 0 Files : 113 113 0 0 0 0 Bytes : 42.96 m 42.96 m 0 0 0 0 Times : 0:00:01 0:00:00 0:00:00 0:00:00 Speed : 83744483 Bytes/sec. Speed : 4791.897 MegaBytes/min. Ended : Wed Oct 22 22:26:14 2014
Copy directory structure
Run the below Robocopy command to copy directory structure i.e deep copy of folder hierarchy and the data in all the subfolders.
Robocopy /S D:\dir1\data E:\backup\data
This command does not copy empty directories. To copy them, you need to add /E switch.
Robocopy /S /E D:\dir1\data E:\backup\data
Delete files and directories from the source after copying
You can add /MOV switch to delete files and /MOVE switch to delete both files and directories.
For deleting files:
Robocopy /MOV /S /E D:\dir1\data E:\backup\data
For deleting files and directories:
Robocopy /MOVE /S /E D:\dir1\data E:\backup\data
Modify file attributes for the copied files
Using robocopy command we can also change attributes(system, hidden, readonly) of the copied files. This affects the attributes of the files in the new location, it does not impact the files in the source directory.
For example to copy all files from one directory to another directory and also set hidden attribute for all the files you can trigger ‘Robocopy’ with the below syntax.
Robocopy /S /E /A+:H D:\dir1\data E:\backup\data
Mirror copy a directory
Below Robocopy command creates a replica of the source folder in the specified destination folder
Robocopy /MIR sourceFolder destinationFolder
This command also deletes any extra files that are present in the destination and are not present in source.
Replicate access permission on destination folder
The option ‘/sec’ copies all the file access permissions to the destination folder also.
robocopy /sec sourceFolder destinationFolder
Note that Robocopy copies the security ACLs also to the destination only if the file has been modified. If the file has not been modified, the ACLs won’t be applied on the destination. You can check this Microsoft’s post robocopy file permissions for deeper understanding.
Robocopy: Better, Faster, Stronger. It’s hard to take a product called “Robocopy” seriously! Anyone doing much storage work on Microsoft Windows machines is familiar with Robocopy. It’s the best tool to move data between NTFS filesystems, since Robocopy maintains permissions and file attributes.
My name is PaRa Mu Dita, a web Master, web Developer and Adventurer. Doing work for last 2 years and Running A lot of Techno Sites.