How to Transfer Files With Robocopy on Windows

Georgi Karaivanov
Georgi Karaivanov

Updated · Dec 01, 2022

SHARE:

Techjury is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission. Learn more.

Do you need to transfer a large volume of data from one Windows PC to another? You can do so using a USB flash drive, but the more efficient approach would be to try a powerful command tool built into Windows called Robocopy.

If you’re wondering how to transfer files with Robocopy on Windows, you’ve come to the right place.

What Is Robocopy?

Robocopy (robust file copy) is a powerful command-line tool built into Windows OS that lets users copy and synchronize files from one location to another. 

It was first introduced with Windows Resource Kit NT 4.0, and it has become a standard feature in Windows since Windows Vista and Windows Server 2008.

The Robocopy file tool was designed to be more efficient at mirroring and copying folders or directories than the standard file copy command tools included in Windows, like Xcopy. It offers numerous useful features and switches, including the ability to:

  • Copy files across a network with the option to resume the operation in case of a network failure.
  • Copy files from point A to point B on the same PC.
  • Preserve file and directory attributes, such as timestamps.
  • Copy NTFS permissions, ownership information, and auditing info.
  • Exclude NTFS junction points from being copied.
  • Copy files in backup mode to override file permission settings.
  • Synchronize two folders.
  • Use the multithreaded mode for copying multiple files at once.

How to Transfer Files With Robocopy on Windows

Transferring files from one Windows PC to another involves two steps. First, you must set up file sharing on the source device and then use Robocopy to transfer the files to the destination device. 

These steps apply to both Windows 10 and 11.

Configure File Sharing on the Source Device

Follow these steps to set up file sharing on the source device:

  1. Go to File Explorer.
  2. Find the folder that contains the files you want to copy.
  3. Right-click the folder and click on Properties.

right click dropdown menu of folder in windows with the properties option highlighted

  1. Open the Sharing tab and click on Share.

sharing tab in the folder properties settings with the share button highlighted

  1. Select the specific users you want to share the folder with, or select Everyone and click Add

network access options of a file with Everyone selected in the dropdown menu

  1. Under Permission Level, select the type of permission you want other users to have. For example, select Read (default) if you only want users to be able to open and view the files. Alternatively, select Read/Write if you're going to allow users to read and modify the shared folder's content. 

permission level settings for file sharing in windows with the dropdown menu highlighted

  1. Then, click on Share.
  2. Note down the network path of the shared folder and click on Done.

Before moving on to the next step, also makes sure to note down the IP address of the source computer. You can do this by opening Settings > Network & Internet > Wi-Fi and clicking on the connection to view the information. 

Copy Files Fast Over the Network on Windows 10 Using Robocopy

Once you’ve configured file sharing on the source device, the next step involves using Robocopy to copy the files to the destination computer. 

Follow these steps to copy files over the network on Windows 10:

  1. Type cmd in the search bar and select the Run as Administrator option. 
  2. To copy the files over the network, type in the following command in the Command Prompt:
robocopy \\source-device-ip\path\to\share\folder C:\destination-device\path\to\store\files /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16

In this command, replace source-device-IP with the IP address of the source computer and path/to/share/folder with the network path of the folder you are sharing. Also, type in the destination path, which is where you want the files to be copied on the destination device.

For example,

robocopy \\192.0.2.1\Users\admin\Documents\ShareFile C:\Users\User\Documents /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16

Simply change the source and destination paths with your specific information and hit Enter.

Copy Files Fast Over Network on Windows 11 Using Robocopy

Here is how to use Robocopy to transfer files over the network on Windows 11

  1. Type cmd in the search bar and choose Run as administrator.
  2. Type the following command in Command Prompt:
cmdkey /add:COMPUTER-OR-DOMAIN /user:COMPUTER-OR-DOMAIN\USERNAME /pass:PASSWORD

Replace COMPUTER-OR-DOMAIN with the destination computer’s IP address or domain. Similarly, replace COMPUTER-OR-DOMAIN\USERNAME with the destination device and username and PASSWORD with the account password.

This will allow you to add the network user and password to Windows 11.

  1. Then, type in the following command:
robocopy \\source-device-ip\path\to\share\folder C:\destination-device\path\to\store\files /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16 /compress

Enter the IP address of the source device and the network path of the shared folder, and the destination path. For instance:

robocopy \\192.0.2.1\Users\admin\Documents\ShareFile C:\Users\User\Documents /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16.

Make sure to type in your specific source and destination paths. Then, press Enter.

Robocopy Command Options Explained

Here is what each Robocopy option when it comes to switches in the command above means:

  • /E - copy subdirectories, automatically including empty ones. To exclude empty subdirectories, use the /S option instead.
  • /Z - copy files in ‘restartable mode’ (in case a file copy is interrupted, Robocopy will pick up right where it left off instead of re-copying the entire file)
  • /ZB - uses ‘restartable mode’ to copy files (in case file access is denied, it switches to backup mode)
  • /R:5 - five retries on failed copies (you can use any other number, with the default being 1 million)
  • /W:5 - five seconds waiting time between retries (again, you can specify a different time, the default is 30 seconds)
  • /TBD - the system will wait for the share names to be defined 
  • /NP - No Progress - the progress percentage for the copying operation will not be displayed.
  • /V - produce verbose output and show all skipped files.
  • /MT:16 - create multi-threaded copies with 16 threads (replace 16 with any number between 1 and 128, with the default being 8).
  • /compress (only for Windows 11) - compress the files being transferred (if applicable).

To view all the available switches, run the robocopy/? command in the Command Prompt.

Alternatively, if you're looking for a software-based solution you can check out our selection of best data migration software picks.

Bottom Line

Now that you know how to transfer files with Robocopy on Windows, you can move a large number of files from one computer to another without using a USB flash drive. Remember, you first need to configure file sharing on the source device to be able to copy the files to the destination device with Robocopy.

SHARE:

Georgi Karaivanov

Georgi Karaivanov

My fascination with technology began from quite an early age thanks to computers and video games. Nowadays, I love anything related to music production and astronomy. Coincidentally (or is it?), both of those have a great deal to do with tech. Honestly, most of the stuff that can be accomplished with modern electronics kind of seems like magic to me. This is why I feel this strong need to constantly learn more about it and talk about it, almost to the detriment of others.

Leave your comment

Your email address will not be published.