ROBOCOPY Command builder

The Robocopy Command Builder generates ready-to-run robocopy commands for Windows backup, file copy, and folder synchronization tasks without memorising switches. Choose a preset for common scenarios — mirror backup, incremental sync, network-resilient copy — enter your source and destination paths, and get a validated command with a plain-English explanation of what it will do.

Advanced mode gives full control over copy flags (data, attributes, timestamps, ACLs, owner, auditing), file and folder exclusions, retry behaviour, thread count, and log output. Expert mode unlocks the full robocopy switch set — file age and size filters, attribute selectors, backup mode, restartable mode, bandwidth throttling, and verbose logging control. Paths entered in any mode carry over automatically when you switch tabs. The command updates in real time. All processing happens in the browser — no data is sent to a server.

What is robocopy and when to use it

Robocopy (Robust File Copy) is a built-in Windows command-line tool used for file copying, backup, and folder synchronization. It is widely used by system administrators for transferring large datasets, performing incremental backups, and working with network shares.

Unlike basic copy tools, robocopy supports retry logic, multithreading, and preservation of file permissions. However, its large number of switches makes it difficult to use without documentation — which is where a command builder becomes useful.

Mirror backup
Exact copy — delete extras in dest
Simple copy
Copy files, skip existing
Incremental sync
New and changed files only
Move files
Copy then delete from source
Network resilient
Retry logic for slow connections
Archive backup
Copy files with archive flag
Paths
Local folder or UNC path
Enter your source path
Created automatically if it does not exist
Enter your destination path
What will this do?

Generated command

How to use

Quick mode

  1. Select a preset that matches your scenario. Each preset shows a short description of what it does.
  2. Enter the Source path — the folder you want to copy from. Use a local path such as C:\Data or a UNC path such as \\server\share.
  3. Enter the Destination path — the folder to copy into. It will be created automatically if it does not exist.
  4. The generated command and an explanation of its switches appear on the right. Click Copy to copy the command to your clipboard.

Advanced mode

  1. Enter Source and Destination paths at the top. Optionally add a file filter such as *.docx *.xlsx to copy only specific file types.
  2. Under What to copy, toggle the copy behaviour — subdirectories, mirror, move, purge, or create directory tree only.
  3. Under Copy flags, select which file properties to copy. The default (D, A, T) covers data, attributes, and timestamps. Add S and O to preserve NTFS permissions and ownership.
  4. Optionally exclude files or folders by entering space-separated masks or folder names under Exclude.
  5. Adjust retry count and wait time under Retry & wait, and set the thread count and log file path under Performance & logging.
  6. The right panel updates the command and explanation in real time. Click Copy when ready.

Expert mode

Expert mode is for scenarios where Advanced mode does not provide enough control. Paths and file filters carry over automatically from Quick and Advanced — you do not need to re-enter them.

  1. Under Copy mode, enable restartable mode (/Z), backup mode (/B), or the combined /ZB which tries restartable and falls back to backup mode if access is denied. Use /EFSRAW to copy EFS-encrypted files in raw mode. Enable /256 for paths longer than 256 characters, or /LFSM to pause automatically when the destination disk is running low on space.
  2. Under File age filters, set /MAXAGE to copy only recently modified files (for example, files changed in the last 30 days), or /MINAGE to skip recent files and copy only older ones. Values can be a number of days or a date in YYYYMMDD format.
  3. Under File size filters, use /MAX to skip files larger than a given size in bytes, or /MIN to skip files smaller than a given size.
  4. Under Attribute filters, use /IA to copy only files with specific attributes set (for example A for archive-flagged files), or /XA to exclude files with specific attributes (for example H to skip hidden files).
  5. Under Performance & logging, use /IPG to throttle bandwidth on slow WAN links — note this is incompatible with /MT. Use /LOG+ to append to an existing log instead of overwriting it. Enable /TEE to write output to both console and log file simultaneously. Use /NFL, /NDL, /NS, and /NC to suppress specific parts of the log output for cleaner results.
  6. The command and explanation on the right update in real time. Click Copy when ready.
Note: Paths and file filter entered in Quick or Advanced mode carry over automatically when you switch to Expert mode — you do not need to re-enter them.

Frequently asked questions

Frequently asked questions

Robocopy (Robust File Copy) is a command-line file copying tool built into Windows since Vista. It supports recursive directory copies, retry on failure, multithreaded copying, file attribute and permission preservation, and incremental sync. It is the standard choice for reliable file copy tasks in Windows environments, replacing the older xcopy command.

Practical examples

Daily mirror backup of a documents folder

Select the Mirror backup preset, set source to your documents folder and destination to a backup drive, then schedule the generated command with Task Scheduler:

robocopy "C:\Users\Zaur\Documents" "D:\Backup\Documents" /MIR /R:3 /W:5 /NP /LOG:"D:\Backup\logs\documents.log"
Note: /MIR will delete files in the destination that no longer exist in the source. Make sure the destination is a dedicated backup location and not a shared folder.

Copy files from a network share preserving NTFS permissions

Use Advanced mode, enable Include subdirectories, and add the S and O copy flags to preserve ACLs and ownership during a file server migration:

robocopy "\\OldServer\Finance" "\\NewServer\Finance" /E /COPY:DATO /R:5 /W:10 /MT:4 /NP /LOG:"C:\Logs\migration.log"
Warning: Copying ACLs (/COPY:S) requires the account running robocopy to have SeBackupPrivilege on the source and SeRestorePrivilege on the destination. Run the command as an administrator or a service account with those rights.

Incremental sync excluding temp and log files

Use Advanced mode with Include subdirectories enabled, add exclusion masks for temporary and log files, and keep the retry values low for a fast local copy:

robocopy "C:\Projects" "E:\ProjectsBackup" /S /XF *.tmp *.log ~* /XD .git node_modules /R:1 /W:2 /MT:16 /NP

Copy only files modified in the last 7 days

Use Expert mode and set Max age to 7 to copy only recently modified files — useful for a daily hot-data sync without touching the full archive:

robocopy "C:\Data" "D:\HotBackup" /S /MAXAGE:7 /R:3 /W:5 /MT:8 /NP

Copy system-locked files using backup mode

Use Expert mode and enable /ZB to access files restricted by ACLs or held open by the system — useful when copying from directories with restricted permissions:

robocopy "C:\Windows\System32\config" "D:\SystemBackup\config" /ZB /COPY:DAT /R:3 /W:5 /NP /LOG:"D:\SystemBackup\logs\config.log"
Warning: Backup mode (/B and /ZB) requires the account running robocopy to hold the SeBackupPrivilege right. Run the command as an administrator or a dedicated backup service account.

Run robocopy as a scheduled task in PowerShell

Wrap the generated command in a PowerShell script to handle exit codes correctly — robocopy uses non-zero exit codes even on success:

robocopy "C:\Data" "D:\Backup\Data" /MIR /R:3 /W:5 /NP /LOG:"D:\Backup\logs\data.log"
if ($LASTEXITCODE -le 7) {
    Write-Host "Robocopy completed successfully (exit code $LASTEXITCODE)"
    exit 0
} else {
    Write-Error "Robocopy failed with exit code $LASTEXITCODE"
    exit 1
}
Note: Robocopy exit codes 0–7 all indicate success or partial success. Exit codes 8 and above indicate copy errors. Wrapping with this pattern prevents Task Scheduler from marking a successful job as failed.

Useful links

Other tools

Related articles