2018-05-03 17:35:50 +01:00
|
|
|
# xcopy
|
|
|
|
|
|
|
|
> Copy files and directory trees.
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/xcopy>.
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- Copy the file(s) to the specified destination:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}}`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- List files that will be copied before copying:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}} /p`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- Copy the directory structure only, excluding files:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}} /t`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- Include empty directories when copying:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}} /e`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- Keep the source ACL in the destination:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}} /o`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- Allow resuming when network connection is lost:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}} /z`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
- Disable the prompt when the file exists in the destination:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`xcopy {{path\to\file_or_directory}} {{path\to\destination_directory}} /y`
|
2018-05-03 17:35:50 +01:00
|
|
|
|
2024-01-30 04:55:24 +00:00
|
|
|
- Display help:
|
2018-05-03 17:35:50 +01:00
|
|
|
|
|
|
|
`xcopy /?`
|