Robocopy Basics: The Switches You Actually Need

Download now

Robocopy's full switch list is long, but a small set covers the vast majority of real-world copy, backup, and mirror jobs. Here's what they do and where the sharp edges are.

Updated August 9, 2026 · PC Utility Hub Editorial Team

Basic syntax

Source and destination are folder paths, not file paths — robocopy always operates on directories (optionally with a file mask). Run from an elevated Command Prompt or PowerShell if copying system or protected folders.

robocopy <source> <destination> [files] [options]
robocopy C:\Data D:\Backup /E
robocopy C:\Data D:\Backup /MIR /Z /R:2 /W:5 /MT:16 /LOG:C:\Logs\backup.log

Core switches

SwitchEffect
/ECopies subdirectories, including empty ones.
/MIRMirrors the destination to match the source exactly, including deleting files in destination that no longer exist in source.
/ZCopies files in restartable mode, so an interrupted large file resumes instead of restarting from scratch.
/R:nSets the number of retries on a failed copy (default is a very high 1,000,000 — always set this explicitly).
/W:nSets the wait time in seconds between retries (default 30 seconds — usually too long for routine jobs).
/MT:nCopies files multi-threaded with n threads (default 8 when used without a number), which speeds up jobs with many small files.
/XOExcludes older files — skips overwriting a destination file if it's newer than or the same age as the source version.
/LOG:pathWrites a full log to the given file (overwriting it); use /LOG+ to append instead.

The /MIR warning: it deletes files

Warning: /MIR makes the destination an exact mirror of the source. Any file or folder present in the destination but not in the source will be deleted. Test with /L (list-only, no changes) first, and double-check source and destination are the right way around before running /MIR for real.

Testing safely with /L

Add /L to any robocopy command to run it in list-only mode: it reports exactly what would be copied, overwritten, or deleted without touching any files. This is the safest way to validate a /MIR command before letting it run for real, especially the first time you point it at a given source/destination pair.

robocopy C:\Data D:\Backup /MIR /L

Realistic retry and wait settings

Robocopy's defaults (1,000,000 retries at 30 seconds each) exist for unattended jobs over flaky network links, but on a local job a locked file will otherwise appear to hang for a very long time. For interactive use, /R:2 /W:5 fails fast and moves on, and you can always re-run for anything skipped.

Logging and scheduling

Combine /LOG with Task Scheduler to run unattended mirror or backup jobs on a schedule. Review logs periodically — robocopy exit codes (visible via %errorlevel% in a batch file) indicate whether files were copied, mismatched, or failed, and a silent failure in a scheduled job is easy to miss without checking the log.

Robocopy vs a GUI or TeraCopy

Robocopy is the right tool for scripted, scheduled, and mirror-style jobs where you control both ends precisely. For a one-off graphical copy with visual progress and verification, TeraCopy or Explorer's native copy is simpler. See our Robocopy vs TeraCopy comparison for a fuller breakdown.

Frequently asked questions

Does /MIR delete files permanently?
Yes — files removed by /MIR go straight to deletion, not the Recycle Bin, unless you add a separate mechanism. Always test with /L first.
What's the difference between /MIR and /E?
/E copies all subfolders including empty ones but never deletes anything in the destination. /MIR does the same copying but also deletes destination files/folders absent from the source.
How many threads should I use with /MT?
/MT:8 (the implied default) works for most cases; going higher (/MT:16 or /MT:32) can help with many small files on fast storage but can also saturate a network link — test on your actual hardware.
Why did robocopy report 'skipped' for some files?
By default robocopy skips files that already appear identical (same size and timestamp) at the destination — that's expected behavior, not an error.