Robocopy Basics: The Switches You Actually Need
Download nowRobocopy'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.logCore switches
| Switch | Effect |
|---|---|
| /E | Copies subdirectories, including empty ones. |
| /MIR | Mirrors the destination to match the source exactly, including deleting files in destination that no longer exist in source. |
| /Z | Copies files in restartable mode, so an interrupted large file resumes instead of restarting from scratch. |
| /R:n | Sets the number of retries on a failed copy (default is a very high 1,000,000 — always set this explicitly). |
| /W:n | Sets the wait time in seconds between retries (default 30 seconds — usually too long for routine jobs). |
| /MT:n | Copies files multi-threaded with n threads (default 8 when used without a number), which speeds up jobs with many small files. |
| /XO | Excludes older files — skips overwriting a destination file if it's newer than or the same age as the source version. |
| /LOG:path | Writes 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 /LRealistic 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.
Related pages
- Robocopy GUIClarifies that Robocopy is CLI-only and surveys GUI front-ends, including the discontinued RichCopy.
- TeraCopy vs RobocopyA side-by-side look at TeraCopy and Robocopy to help pick the right tool for a given copy job.
- TeraCopyOverview of TeraCopy's copy/verify features, editions, and official download source.
- DiskpartOverview of the diskpart cmd tool and its core disk and partition commands.
- Diskpart Clean & Format USBCommands to safely wipe and reformat a USB flash drive with diskpart.