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.