Example usage for xcopy.
xcopy C:\project D:\backup\project /e /i /yCopy files and directory trees with selection and recursion options.
xcopy <Source> [<Destination>] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d [:MM-DD-YYYY]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [{/a | /m}] [/n] [/o] [/x] [/exclude:FileName1[+[FileName2]][+[FileName3]]] [{/y | /-y}] [/z] [/b] [/j] [/compress]The linked Microsoft Learn article is the upstream authority. Availability may depend on Windows release, role, optional feature or interactive tool context.
Example usage for xcopy.
xcopy C:\project D:\backup\project /e /i /y| Option / clause | Description |
|---|---|
/s | Copy non-empty directories and their subdirectories. |
/e | Copy all subdirectories, including empty ones. |
/i | Assume the destination is a directory when it does not exist. |
/d[:date] | Copy files changed on or after the specified date. |
/h | Include hidden and system files. |
/y | Suppress overwrite confirmation prompts. |
--- | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
<Source> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
[<Destination>] | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
/w | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/p | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/c | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/v | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/q | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/f | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/l | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
<Destination> | Microsoft documents this argument or subcommand; check the linked reference for its required format and context. |
/g | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/u | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/t | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/k | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/r | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/a | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/m | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/n | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/o | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/x | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/exclude:FileName1 | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
-y | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/z | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/b | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/j | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
/compress | Microsoft documents this switch; use the linked reference for accepted values, effects and version limits. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.