Skip to content

VersusOS

Robocopy vs Xcopy: Which Windows Copy Command Should You Use?

Windows 11 includes two command-line tools for copying folders: xcopy and Robocopy. Using Microsoft's official command references, we compare what each can do, from mirroring and multi-threaded copies to retries, restartable mode and logging, and explain which to use for quick copies and which for backups.

By , Senior Hardware Editor

4 min read

Robocopy vs Xcopy: Which Windows Copy Command Should You Use?

Windows 11 still ships with two command-line tools for copying whole folders: the veteran xcopy and the more powerful Robocopy. Both are free, built in and documented by Microsoft, but they suit different jobs. This comparison is based on Microsoft's official command references.

The short version

Robocopy

Xcopy

What Microsoft says it does

"Copies file data from one location to another"

"Copies files and directories, including subdirectories"

Copy subfolders

/s (skips empty) or /e (includes empty)

/s (skips empty) or /s /e (includes empty)

Mirror a folder (delete extras at the destination)

Yes, /mir

No

Multi-threaded copying

Yes, /mt (default 8 threads, 1 to 128)

No

Restartable copies

Yes, /z and /zb

Yes, /z (over a network)

Automatic retries

Yes, /r and /w

No

Log file

Yes, /log, /log+ and /tee

No (but /l lists what would be copied)

Skip files that haven't changed

Yes, /xo excludes source files older than the destination

Yes, /d copies files newer than the destination

Both commands are listed by Microsoft as applying to Windows 11 and Windows 10.

Xcopy: simple and familiar

Xcopy is easy to remember and fine for one-off copies. Microsoft's own example for copying everything, including empty subfolders, from one drive to another is:

xcopy a: b: /s /e

A few things catch people out. By default, Microsoft says, xcopy "doesn't copy hidden or system files", so add /h if you need them. If the destination folder doesn't exist, xcopy asks whether it's a file or a directory unless you add /i. Other useful switches include /d to copy only files changed on or after a date (or newer than the destination copy if you leave the date out), /y to skip overwrite prompts, /l to list the files that would be copied without copying them, /v to verify each file as it's written and /j to copy without buffering, which Microsoft recommends for very large files.

Microsoft also warns that an "insufficient memory" error may occur if you use xcopy on a file or folder whose path is longer than 255 characters, which can bite in deeply nested game or project folders.

Robocopy: built for big jobs and backups

Robocopy has far more options, and several of them matter on a home PC:

  • /mir mirrors a folder tree. Microsoft describes it as equivalent to /e plus /purge, and /purge "Deletes destination files and directories that no longer exist in the source". That makes it handy for keeping a backup drive in step with your files, but it also means files you've deleted from the source will be deleted from the backup. Double-check the source and destination before you run it.

  • /mt creates multi-threaded copies. Microsoft says n must be between 1 and 128, the default is 8, and for better performance you should redirect output with /log.

  • /z copies in restartable mode, so if a copy is interrupted Robocopy "can pick up where it left off rather than recopying the entire file". /zb switches to backup mode if access is denied.

  • /r and /w control retries. The defaults are 1,000,000 retries and 30 seconds between them, so if a file is locked a copy can appear to hang. Microsoft's own example uses /R:2 /W:5.

  • /log writes the status output to a file, /log+ appends to one, and /tee shows output in the window and the log. Microsoft says it's "highly recommended" to create a log file so you can check the result afterwards.

A typical backup-style command, adapted from Microsoft's examples, looks like this:

robocopy C:\Users\YourName\Documents D:\Backup\Documents /MIR /R:2 /W:5 /LOG:D:\Backup\robocopy.log

Two more things to know. Robocopy copies data, attributes and time stamps by default (/COPY:DAT). And its exit codes work differently from most commands: Microsoft lists 1 as "All files were copied successfully" and 0 as nothing copied because the files were already there, so don't treat any non-zero code as a failure in a script.

For a step-by-step walkthrough, see our guide on how to copy large folders with Robocopy. If you'd rather use a graphical tool, we compare two popular ones in TeraCopy vs FastCopy.

Which should you use?

Use xcopy for quick, one-off copies of a folder where you just want everything moved across, and remember /s /e /h /i for a complete copy. Use Robocopy for anything big, anything over a network, anything you'll repeat, or anything you want to check afterwards, thanks to its retries, restartable mode, logging and mirror option.

Neither is a full backup app, though: they copy files, they don't keep version history. For that, see our pick of the best free backup software for Windows or our guide to File History in Windows 11. And if you want a Robocopy job to run on a schedule, our Task Scheduler guide shows how.

The bottom line

For most Windows 11 users, Robocopy is the better choice: it can mirror folders, copy with multiple threads, resume interrupted copies, retry locked files and write a log, all of which make it far more dependable for large copies and backups. Xcopy is still fine for quick one-off folder copies, as long as you add /s /e and /h. Be careful with Robocopy's /mir, which deletes files at the destination that no longer exist in the source.

Sources

  1. 01Microsoft Learn: robocopy
  2. 02Microsoft Learn: xcopy

About the author

Callum Reid

Senior Hardware Editor

Callum leads GPU, CPU and platform architecture coverage at Forge PC. Before joining the editorial desk, he spent nine years specifying, assembling and stress-testing custom gaming and workstation systems in the UK, with a focus on PCIe bandwidth, VRM thermal design, DDR5 memory tuning and 1440p/4K frame-time consistency.

More from Callum Reid

Read next

How to Check Your PC's Uptime and Last Boot Time in Windows 11

How-To

How to Check Your PC's Uptime and Last Boot Time in Windows 11

How long has your PC been running since it last started? We show three built-in ways to check uptime and last boot time in Windows 11, using Task Manager, the systeminfo command and PowerShell, and explain why Fast Startup can make the uptime look longer than you expect.

Marcus Thorne3 min

How to Force-Close a Frozen App or Game in Windows 11

How-To

How to Force-Close a Frozen App or Game in Windows 11

When a game or app freezes and won't close, Windows 11 gives you three ways to force it shut. Following Microsoft's documentation, we show how to use Task Manager, turn on the taskbar's hidden End task option, and use tasklist and taskkill to find and end unresponsive processes.

Marcus Thorne3 min

How to Denoise Renders with Intel Open Image Denoise's oidnDenoise Tool

How-To

How to Denoise Renders with Intel Open Image Denoise's oidnDenoise Tool

Intel Open Image Denoise includes oidnDenoise, a free command-line tool that runs the AI denoiser on a saved render using your CPU or a supported NVIDIA, AMD, Intel or Apple GPU. Here's how to download it, prepare PFM images and denoise with albedo and normal passes.

Marcus Thorne3 min

How to Use BGInfo to Show Your PC's Name, IP Address and Specs on the Desktop

How-To

How to Use BGInfo to Show Your PC's Name, IP Address and Specs on the Desktop

Want your PC's name, IP address and key details on screen without digging through Settings? Following Microsoft's official documentation, we show how to set up the free Sysinternals tool BGInfo, choose its fields, save a configuration and refresh it at every sign-in, plus its most useful command-line options.

Marcus Thorne3 min