Skip to content

How-ToOS

How to Copy Large Folders Reliably on Windows with Robocopy

How to use Robocopy, the copy tool built into Windows 10 and 11, to copy large folders reliably: restartable and multi-threaded copies, retries, logs, dry runs, mirroring and exit codes.

By , Systems & Technical Editor

5 min read

How to Copy Large Folders Reliably on Windows with Robocopy

The options and exit codes below come from Microsoft's official robocopy documentation, read on 23 November 2026.

Dragging a huge folder in File Explorer works most of the time. But if one file fails halfway through a copy of a game library, photo archive or AI model folder, it's hard to tell what made it across. Robocopy ("robust file copy") is a command-line tool built into Windows. Microsoft lists it as applying to Windows 10 and Windows 11 as well as Windows Server. It gives you more control: it can retry failed files, resume interrupted copies, skip files that are already up to date and write everything to a log file.

The basic command

Open Terminal or Command Prompt and use this pattern:

robocopy <source> <destination> [<file>] [<options>]

If you don't name any files, robocopy copies everything (*.*). By default it copies only the files in the top-level folder, so you'll almost always add /e to include subfolders.

A sensible starting point for copying a big folder to a new drive looks like this:

robocopy "D:\Photos" "E:\Photos" /e /z /mt:8 /r:3 /w:5 /log:"C:\Logs\photos.log" /tee

Here's what each part does, according to Microsoft:

Option

What it does

/e

Copies subfolders, including empty ones (/s skips empty folders)

/z

Restartable mode: if a file copy is interrupted, robocopy can pick up where it left off

/mt:8

Multi-threaded copy with 8 threads. You can choose 1 to 128, and 8 is the default if you use /mt on its own

/r:3

Retries a failed file 3 times

/w:5

Waits 5 seconds between retries

/log:file

Writes the output to a log file and overwrites any existing log (/log+: appends)

/tee

Shows the output in the window as well as writing it to the log

The retry options matter more than they look. Microsoft says the default is 1,000,000 retries with a 30-second wait between each one. If a file is locked, a copy without /r and /w can sit there for a very long time.

Step 1: Do a dry run first

Add /l to any command to list what robocopy would do without copying, deleting or changing timestamps. This is the safest way to check your paths, especially before you use the mirror option below:

robocopy "D:\Photos" "E:\Photos" /e /l

Step 2: Run the copy and keep a log

Remove /l and run the real command. Microsoft recommends creating a log file so you can check afterwards that the copy completed properly. It also says that when you use /mt, sending the output to a log with /log gives better performance. Add /np if you don't want per-file progress percentages filling the log.

If the copy is interrupted, for example because a USB drive disconnects, run the same command again. Files that are already identical are skipped, and with /z a partly copied file can resume rather than start again.

Step 3: Skip what you don't need

Two exclusion options keep large copies tidy:

  • /xf excludes files that match names or wildcards, for example /xf *.tmp.

  • /xd excludes folders, for example /xd "D:\Photos\Cache".

For repeat copies, /xo skips source files that are older than the copy already in the destination.

Step 4: Mirror a folder (carefully)

/mir mirrors a folder tree. Microsoft describes it as equivalent to /e plus /purge, and /purge deletes files and folders in the destination that no longer exist in the source. That makes /mir useful for keeping a backup copy of a folder in sync. It also means that if you get the source and destination the wrong way round, or point it at the wrong folder, it can delete files. Always do a /l dry run first, and never point /mir at the root of a drive that holds anything else.

One more quirk to know: Microsoft warns that if you copy from the root of a device (such as D:\), the destination folder picks up the "hidden" and "system" attributes. Copy a named folder instead where you can.

Step 5: Read the exit code

When robocopy finishes, it reports an exit code. Unlike most commands, a non-zero code doesn't always mean failure:

Code

Meaning (Microsoft)

0

Nothing copied, because the files already exist in the destination

1

All files copied successfully

2

Extra files in the destination that aren't in the source; nothing copied

3

Some files copied and extra files present; no failures

8 or higher

At least one file failed to copy

If you script robocopy in a batch file, treat 8 and above as an error, not anything other than 0.

Copying file permissions

By default robocopy copies file data, attributes and timestamps (/copy:DAT). That's what most home users want when moving files to a new drive. If you're copying between NTFS volumes and need to keep security permissions too, /sec adds NTFS access control lists, and /copyall copies all file information, including owner and auditing details.

When to use something else

Robocopy copies files and folders, not whole drives. To move Windows itself to a new SSD, use a cloning tool (see how to clone an SSD with free tools). For scheduled, versioned backups, a dedicated app is easier to manage; see our best free backup software for Windows and how to back up Windows 11. If you're adding a drive to make room, our guide to adding more storage to your PC covers the hardware side.

Our verdict

Robocopy is already on every Windows 10 and Windows 11 PC, and it's the most dependable built-in way to copy a large folder. Start with /e, /z and a log file, set /r and /w so a locked file can't stall the job for hours, and add /mt, which Microsoft describes as giving higher performance. Do a dry run with /l before anything that deletes, especially /mir and /purge. Afterwards, check the exit code: 0 to 3 means no failures, while 8 or above means at least one file didn't copy.

The bottom line

Robocopy is already on every Windows 10 and Windows 11 PC, and it's the most dependable built-in way to copy a large folder. Start with /e, /z and a log file, set /r and /w so a locked file can't stall the job for hours, and add /mt, which Microsoft describes as giving higher performance. Do a dry run with /l before anything that deletes, especially /mir and /purge. Afterwards, check the exit code: 0 to 3 means no failures, while 8 or above means at least one file didn't copy.

Sources

  1. 01Microsoft Learn, robocopy command reference

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Set Up a UPS to Shut Down Your PC Automatically

How-To

How to Set Up a UPS to Shut Down Your PC Automatically

How to make a UPS shut your PC down automatically in a power cut: connect the UPS's USB data cable, install the maker's software (CyberPower PowerPanel Personal as the example), choose Keep Computer Running or Preserve Battery Power, pick shutdown or hibernation, then test it.

Marcus Thorne7 min

Clonezilla vs Rescuezilla: Which Free Disk Imaging Tool Should You Use?

Versus

Clonezilla vs Rescuezilla: Which Free Disk Imaging Tool Should You Use?

Clonezilla vs Rescuezilla: both are free bootable disk imaging and cloning tools that share an image format. Clonezilla adds network destinations, encryption, scripting and mass deployment; Rescuezilla offers a point-and-click desktop, image browsing and extra rescue tools.

Callum Reid6 min

ShareX vs Snipping Tool: Which Free Screenshot Tool Should You Use?

Versus

ShareX vs Snipping Tool: Which Free Screenshot Tool Should You Use?

ShareX vs Snipping Tool: Windows' built-in Snipping Tool is quick and now does local OCR and video snips, while free, open-source ShareX adds scrolling captures, richer annotation, automated after-capture tasks, uploads and many extra tools. Here's which suits you.

Callum Reid7 min

How to Set Up SillyTavern with a Local LLM Using KoboldCpp

How-To

How to Set Up SillyTavern with a Local LLM Using KoboldCpp

How to set up SillyTavern with a local LLM: installing it on Windows or Linux, loading a GGUF model in KoboldCpp, connecting the two, tuning GPU layers to fit your graphics card's VRAM, adjusting context settings and fixing common problems.

Marcus Thorne8 min