Wednesday, 24 January 2018

Robocopy multi-threaded feature to speed up file copy on Windows 10

When copy files to another drive, you typically use the standard select, copy, and paste process. Although this process works perfectly fine, speed becomes a bottleneck as trying to transfer a lot of files can take a very long time.


Robust File Copy, which is a command-line tool built into Windows 10 that provides more features to move data to a different location more quickly.
Robocopy so special (and often overlooked) is its multi-threaded feature that allows you to copy multiple files at the same time. Instead of one file at a time using the copy feature built into File Explorer.

You’ll learn to use the multi-threaded copies feature on Robocopy to speed up the transfer process of files and folders to another drive on Windows 10.

Process to use multi-threaded feature with Robocopy

  •  Open Start.
  •  Search for Command Prompt, right-click the result, and select Run as administrator.
  •  Type the following command to copy the files and folders to another drive and press Enter.
 robocopy C:\source\folder\path\ D:\destination\folder\path\ /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:32

robocopy C:\Users\admin\Documents D:\Users\admin\Documents /S /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:32


In the above command make sure to change the source and destination paths with your configuration.

Robocopy Command Fully Explained 

  •  /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 share names to Be Defined (retry error 67). 
  •  /NP — No Progress – don’t display percentage copied. 
  • /V — Produce verbose output, showing skipped files. 
  • /MT:32 — Do multi-threaded copies with n threads (default is 8).

At this point, I am ready to add the new multi-threaded switch: /MT[: n], where n is a number from 1 to 128 and indicates the number of threads to be used. Keep in mind that n is optional and that by default, the /MT switch will use 8 threads. I'll use 32 threads in my example, as I found it to be a good starting point.

Note - Multi-threaded option is not compatible with the /IPG and /EFSRAW switches.

Once you’ve have completed the steps, you’ll notice that copying files and folders will now take significantly less time.


No comments:

Post a comment