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. The command updates in real time as you change options. 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, or purge.
  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.

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

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