Top Robocopy Switches Explained


Top Robocopy Switches Explained: Master the Command Line

Robocopy (Robust File Copy) is Windows’ most powerful built-in file replication tool. Its true power lies in its switches. Here’s a clear explanation of the top Robocopy switches you need to know.

1. The Mirror Switch (/MIR)

The /MIR switch is perhaps the most popular and dangerous. It perfectly mirrors the source to the destination. This means it copies new files, updates changed ones, and deletes any files in the destination that don’t exist in the source.

  • Use Case: Perfect for creating an exact backup copy.
  • Warning: Use with extreme caution, as it will delete files.
Top Robocopy Switches Explained

2. The Multi-Threading Switch (/MT)

Dramatically speed up file copying over networks or to SSDs by enabling multi-threading. The /MT:# switch allows Robocopy to copy multiple files simultaneously.

  • Example: /MT:16 uses 16 threads. The default is 8.
  • Use Case: Copying thousands of small files.

3. The Restartable Mode Switch (/Z)

This switch enables restartable mode. If a transfer is interrupted (e.g., a network drop), Robocopy can pick up where it left off instead of starting over.

  • Use Case: Copying very large files over unstable connections.

4. The “What to Copy” Switches (/E, /XO)

  • /E: Copies all subdirectories, including empty ones. Essential for full backups.
  • /XO: Excludes Older files. Only copies source files that are newer than the destination copies. Great for incremental updates.

5. The Resilience Switches (/R, /W)

These switches control Robocopy’s behavior when it encounters an error.

  • /R:5: Retries a failed copy 5 times (default is 1 million!).
  • /W:5: Waits 5 seconds between retries (default is 30 seconds).

Pro Tip: Combine these switches for a powerful, resilient, and fast copy command:

robocopy C:\Source D:\Backup /MIR /MT:16 /Z /R:5 /W:5

Master these top Robocopy switches to handle any file-copying task with precision and speed. To see all options, run robocopy /? in Command Prompt.


Dlightdaily

Author is a passionate Blogger and Writer at Dlightdaily . Dlightdaily produces self researched quality and well explained content regarding HowToGuide, Technology and Management Tips&Tricks.

FacebookTwitterEmailShare

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.