How to Use the ‘Robocopy’ Command for High-Speed Multithreaded File Transfers in Windows

The Weakness of Windows File Explorer

If you need to copy a few photos to a USB drive, simply dragging and dropping them in the standard Windows File Explorer is fine. But what happens if you need to migrate an entire 4-Terabyte file server to a new location? What if the server contains three million tiny files nested inside hundreds of subdirectories?

Using the standard File Explorer for enterprise-scale transfers is a disaster. It calculates incredibly slowly, it transfers files one at a time (single-threaded), and if the network connection drops halfway through the 4TB transfer, the entire process fails. You have to start over, and Windows will annoyingly prompt you: “Do you want to overwrite this file?” three million times.

The solution is built natively into Windows: Robocopy (Robust File Copy). Run from the command prompt, Robocopy is a multithreaded, fault-tolerant tool designed specifically for migrating massive datasets at maximum speed.

The Basic Syntax

Open the Command Prompt (or PowerShell). The basic syntax requires a source folder and a destination folder.

robocopy "C:\SourceFolder" "D:\DestinationFolder"

By default, this will copy the files, but it will not copy subdirectories. To make Robocopy truly powerful, you must use its extensive library of command flags.

The Ultimate Migration Command

If you are backing up a large drive or migrating a server, this is the command you want to use:

robocopy "C:\SourceFolder" "D:\DestinationFolder" /MIR /MT:32 /R:3 /W:5 /Z /V

Breaking Down the Flags:

  • /MIR (Mirror): This is the most powerful flag. It creates an exact, perfect mirror of the source directory. It copies all subdirectories (even empty ones). Crucially, if you run the command a second time, it will delete files in the destination if they were deleted from the source, ensuring the two folders remain perfectly identical.
  • /MT:32 (Multithreading): This is the secret to Robocopy’s speed. By default, Windows copies one file at a time. The /MT flag tells Windows to copy multiple files simultaneously. You can specify between 1 and 128 threads. (32 is generally a good balance for modern processors; 128 can sometimes choke a mechanical hard drive).
  • /R:3 (Retries): If a file is currently locked (because someone on the network is editing it), File Explorer simply crashes the transfer. This flag tells Robocopy to retry a locked file exactly 3 times before giving up and moving on to the next file. (The default is 1 million retries, which will freeze your backup forever. Always set /R: to a low number).
  • /W:5 (Wait): This pairs with the retry flag. It tells Robocopy to wait 5 seconds between each retry attempt.
  • /Z (Restartable Mode): If you are transferring a massive 50GB video file over a spotty Wi-Fi network and the connection drops at 49GB, the /Z flag allows Robocopy to resume the transfer exactly where it left off when the network reconnects, rather than starting the 50GB file over from scratch.
  • /V (Verbose): This forces the command prompt to output a detailed log to the screen, showing exactly which files were skipped, which were copied, and which failed.

Logging the Output

If you are running a migration overnight, you won’t be awake to read the verbose output on the screen. You should pipe the output into a text file so you can review it the next morning.

robocopy "C:\Source" "D:\Destination" /MIR /MT:32 /R:3 /W:5 > "C:\Admin\migration_log.txt"

The > operator tells Windows to dump the on-screen text directly into the specified text file.

Conclusion

Dragging and dropping works for consumers, but Robocopy is mandatory for IT professionals. By utilizing multithreading and fault-tolerant retry logic, Robocopy can saturate a network connection and seamlessly migrate millions of files without human intervention or catastrophic failures.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.