Robocopy Command Builder
Build a robocopy command from checkboxes, with every switch explained, conflict and danger warnings, presets, command parsing and exit codes.
Robocopy ("robust file copy") ships with every version of Windows and Windows Server and is the standard way to copy, back up, mirror and migrate folders: it retries, resumes, keeps permissions and runs unattended. It also has about a hundred switches. Tick the options you need and the command is built as you go, with each switch explained, warnings for conflicting or dangerous combinations, and the exit code decoded when the job finishes.
Built in your browser. Your paths and options are never sent to tclient.com.
This page runs on your device (WebAssembly), so server and share names stay there. A share link is only created when you click Copy link, and it keeps everything after # in the address, which browsers never send to a server.
Start from a preset
Command
robocopy C:\Data D:\Backup\Data /E /R:2 /W:5
Paste an existing command
Source, destination and files
Command
robocopy C:\Data D:\Backup\Data /E /R:2 /W:5
Switch reference
Copy options
Copy file throttling
File selection
Retry options
Logging options
Job options
Exit codes
Robocopy's exit code is a set of flags added together: 1 files copied, 2 extra files, 4 mismatches, 8 failures, 16 fatal error. Anything below 8 is success, which is why a scheduled task can show "0x1" or "0x3" for a copy that worked.
| Bit | Set? | Meaning |
|---|---|---|
| 1 | Yes | Files copied: One or more files were copied. |
| 2 | No | Extra files: The destination has files or folders that aren't in the source (deleted with /PURGE or /MIR, otherwise just reported). |
| 4 | No | Mismatches: Some files or folders didn't match their counterpart (for example a file in one place and a folder of the same name in the other). |
| 8 | No | Failures: Some files or folders couldn't be copied, even after the retries (/R). |
| 16 | No | Fatal error: Robocopy couldn't do the job at all: an invalid option, or no access to the source or destination. Nothing was copied. |
Common gotchas
A trailing backslash inside quotes breaks the command
Windows reads \" as an escaped quote, so in robocopy "C:\My Data\" D:\Backup robocopy receives
one argument, C:\My Data" D:\Backup, and complains about a missing destination or an invalid parameter. Leave the
trailing backslash off ("C:\My Data"); this builder does it for you.
/MIR in the wrong direction
Robocopy is always source, then destination. Swap them with /MIR and the backup overwrites the live data: files that exist only in the real source are deleted, and changed files are replaced by the backup's older copies. Run with /L first and read the lines marked *EXTRA File: those are the files it would delete.
/MT together with /Z
They work together, but restartable mode records progress inside every file, which eats into the gain from parallel threads. For many small files use /MT alone; keep /Z (or /ZB) for large files over links that drop.
Scheduled tasks behave differently from your prompt
A task runs as its own account, without your mapped drives (use \\server\share paths) and, unless "Run with highest privileges" is ticked, without administrator rights, so /B and /ZB fail with access denied. The task's "last result" is robocopy's exit code: 1 or 3 means success. The .cmd download turns codes below 8 into 0.
Log files and character sets
/LOG writes in the console's old code page, so names with accents or other scripts turn into question marks. /UNILOG writes UTF-16, which is correct but looks double-spaced in tools that expect UTF-8. /LOG also replaces the file each run; use /LOG+ to keep history, and /NP so the percentage counter doesn't fill the log.