ThisCalculator

Everyday

Fast Way to Copy Thousands of Tiny Files in Windows

Updated · Standard formula, shown below

Fast Way to Copy Thousands of Tiny Files in Windows

Yes, Windows has faster ways to copy thousands of tiny files than File Explorer, and the most reliable is the built-in command-line tool robocopy (Robust File Copy). Using robocopy with the right flags can be several times faster than dragging folders in Explorer, especially over a network or when copying to a slow drive. This article explains why File Explorer is slow, how robocopy works, and other options like xcopy and third-party tools.

Why File Explorer Is Slow with Many Small Files

File Explorer (Explorer.exe) is designed for interactive use, not bulk copying. When you copy thousands of tiny files, Explorer does several things that slow it down:

  • Per-file overhead: Each file requires a separate read/write operation. With thousands of tiny files, the overhead of opening, reading, writing, and closing each file adds up.
  • UI updates: Explorer constantly refreshes the progress bar, file count, and speed estimate, which consumes CPU and I/O.
  • File metadata: Explorer reads and writes extended attributes, timestamps, and alternate data streams for each file, which adds extra disk operations.
  • No multi-threading: Explorer copies files sequentially (one at a time) in most cases, so it cannot utilize multiple CPU cores or parallel I/O.

In contrast, robocopy is a command-line tool that can copy files in parallel (with the /MT flag) and has minimal UI overhead, making it significantly faster for large numbers of small files.

Robocopy: The Built-in Faster Copy Tool

Robocopy is included in Windows Vista and later (including Windows 10 and 11). It is a powerful file-copying utility with many options. The most useful flag for speed is /MT (multi-threaded), which copies multiple files simultaneously. For example:

robocopy "C:\source" "D:\destination" /E /MT:16

This command copies all subdirectories (/E) and uses 16 threads. You can adjust the thread count (1-128) based on your CPU and disk. A common recommendation is to use /MT:16 or /MT:32 for a good balance.

Other useful flags include:

  • /R:3 – retry 3 times on failure (default is 1 million, which can hang).
  • /W:5 – wait 5 seconds between retries.
  • /NP – no progress percentage (reduces console output).
  • /LOG:file.txt – write a log file.

Robocopy also handles long paths (over 260 characters) automatically, which File Explorer often fails on.

Xcopy: An Older Alternative

Before robocopy, xcopy was the go-to command-line copier. It is still available and can be faster than Explorer, but it lacks multi-threading. For example:

xcopy "C:\source\*.*" "D:\destination\" /E /C /H /R

This copies all files and subdirectories, even empty ones (/E), continues on errors (/C), copies hidden files (/H), and overwrites read-only files (/R). However, xcopy is generally slower than robocopy with /MT because it copies sequentially.

Third-Party Tools: When You Need More

If you frequently copy huge numbers of tiny files, third-party tools may offer even better performance and features:

  • TeraCopy – integrates with Explorer’s right-click menu, uses a more efficient buffering algorithm, and can pause/resume copies.
  • FastCopy – a lightweight tool that uses different I/O modes (e.g., unbuffered) to speed up copying, especially on HDDs.
  • RoboMirror – a GUI for robocopy, making it easier to use for less technical users.

These tools often show a real speed improvement over Explorer, but robocopy is free and built-in, so it is a good first choice.

How to Choose the Right Method

Your choice depends on the situation:

  • One-time copy of a few thousand files: Use robocopy with /MT:16. It is fast, reliable, and you don’t need to install anything.
  • Copying over a network: Robocopy is especially beneficial because network latency amplifies the per-file overhead. Use /MT and consider /Z (restartable mode) for large transfers.
  • Frequent large-scale copying: Consider a third-party tool with a GUI if you prefer not to use the command line.
  • Copying to a slow USB drive: The bottleneck is the drive itself, so robocopy may not help much, but it will still be more efficient than Explorer.

Common Mistakes and Pitfalls

  • Not using /MT: Without multi-threading, robocopy is only slightly faster than Explorer.
  • Forgetting to include /E: If you want to copy subdirectories, /E is essential. Without it, only files in the root are copied.
  • Using /R:0 and /W:0: This disables retries, which can cause the copy to fail on transient network errors. Better to set /R:3 and /W:5.
  • Ignoring exit codes: Robocopy returns an exit code (0-7) that indicates success or failure. For example, code 1 means files were copied successfully, code 2 means extra files found, code 3 is a combination. Code 8 or higher indicates errors.

Frequently Asked Questions

Is robocopy always faster than File Explorer?

Generally yes, especially with the /MT flag, because it reduces per-file overhead and can copy multiple files in parallel. However, if you are copying a few large files (e.g., 10 GB video files), the difference is negligible because the bottleneck is the disk speed, not the per-file overhead.

What does the /MT flag do exactly?

/MT enables multi-threaded copying, which allows robocopy to copy multiple files simultaneously. The number after /MT specifies the number of threads (e.g., /MT:16). This can significantly speed up copying many small files, but it may not help if the disk is already saturated.

Can robocopy copy files over 260 characters in path?

Yes, robocopy can handle long paths automatically, whereas File Explorer often fails with an error. This is one of the reasons robocopy is preferred for complex directory structures.

How do I see the progress of a robocopy copy?

By default, robocopy shows a progress bar in the console. If you want a cleaner log, use /NP to suppress the progress percentage. You can also use /LOG:file.txt to write a log file, and /TEE to display it on screen and save it.

Is there a way to copy files faster using PowerShell?

PowerShell’s Copy-Item is generally slower than robocopy for many files. However, you can use .NET’s System.IO.File.Copy in a loop, but it still lacks multi-threading. For best performance, stick with robocopy.

What is the best thread count for /MT?

There is no one-size-fits-all. A good starting point is /MT:16 for a typical desktop. If you have a high-end CPU and an SSD, you might try /MT:32 or /MT:64, but beyond that, you may see diminishing returns. Test with your own data to find the sweet spot.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.