Table of Contents
Use Robocopy to copy files to another drive
Robocopy (Robust File Copy) is a command-line tool built into Windows, but it has been around for years, and it’s a powerful and flexible tool to migrate files extremely fast.
robocopy "C:\MDaemon" "E:\MDaemon" /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16 /LOG:C:\log.txt
Robocopy has many features that you can use, and in the command shown in this guide, we’re using the following options to make the 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 is denied, use backup mode.
- /R:5 — Retry 5 times (you can specify a different number, the default is 1 million).
- /W:5 — Wait 5 seconds before retrying (you can specify a different number, the 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:16 — Do multithreaded copies with n threads (default is 8).
Perhaps the most important switch to pay attention to is /MT, an option that enables Robocopy to copy files in multithreaded mode. Typically, when you copy files from File Explorer, you only copy one file at a time.
If you do not 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, but the tool supports “1” to “128” threads.
Use Robocopy to copy files over the network
robocopy "D:\data" "\\10.10.5.89\data" /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Tuesday, May 16, 2023 1:31:12 PM
Source : D:\data\
Dest : \\10.10.5.89\data\
Files : *.*
Options : *.* /TBD /V /S /E /DCOPY:DA /COPY:DAT /ZB /NP /MT:16 /R:5 /W:5
------------------------------------------------------------------------------
New File 6137 D:\data\DSM.ovf
New File 261.3 m D:\data\DSM_DS3617xs_23739.pat
New File 19.8 m D:\data\synoboot.vmdk
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 1 0 0 0 0
Files : 3 3 0 0 0 0
Bytes : 281.26 m 281.26 m 0 0 0 0
Times : 0:02:01 0:00:30 0:00:00 0:00:26
Speed : 9,767,611 Bytes/sec.
Speed : 558.907 MegaBytes/min.
Ended : Tuesday, May 16, 2023 1:32:08 PM
https://www.softwaretesttips.com/robocopy-gui/
To use Robocopy, open the command prompt and type “robocopy [source] [destination] [file name or extension]”. For example, to copy all .txt files from the C: drive to the D: drive, you would type “robocopy C:\ D:\ *.txt”. Robocopy is a powerful command-line tool that can handle complex file-copying tasks and preserve file attributes.
Alternatively, you could consider using efficient solution tools like Gs Richcopy 360 and Teracopy. These tools have a user-friendly interface and are designed to handle large file transfers efficiently. They offer features such as parallel transfers, pause and resume options, and error recovery mechanisms, making file copying tasks faster and more reliable.