CMD Master
Back to Blog
Arnošt Havelka

The Xcopy Command

Copy entire directory trees.

Start Interactive Lesson
The Xcopy Command

The Xcopy Command

When basic copy isn't enough, xcopy (Extended Copy) steps in. It's designed to copy directories, subdirectories, and even file attributes. It's the workhorse of simple backups before you graduate to robocopy.

Usage:xcopy
[source]
[destination]
[/s]
[/e]
/s
Copies directories and subdirectories except empty ones.
/e
Copies directories and subdirectories, including empty ones.
/y
Suppress overwrite prompts.
/d
Copies files specific date or newer.

Real-World Examples

Backup a folder tree:

Command Prompt
C:\Users\User>xcopy C:Docs D:BackupDocs /s /e

Knowledge Check

1 / 2

What is the main difference between copy and xcopy?