XCopy Ü
ßßßßßß
Copies directories, their subdirectories, and files (except hidden and
system files). With this command, you can copy all the files in a
directory, including the files in the subdirectories of that directory.
Syntax: XCOPY source [destination] [/Y|/-Y] [/A|/M] [/D:date] [/P] [/S]
[/E] [/V] [/W]
source
Specifies the location and names of the files you want to copy.
Source must include either a drive or a path.
destination
Specifies the destination of the files you want to copy.
Destination can include a drive letter and colon, a directory name,
a filename, or a combination.
/Y
Indicates that you want xcopy to replace existing file(s) without
prompting for confirmation. By default, if you specify an existing
file as the destination file, xcopy will ask you if you want to
overwrite the existing file.
/-Y
Indicates that you want XCOPY to prompt you for confirmation when
replacing an existing file. Specifying this switch overrides all
defaults and the current setting of the COPYCMD environment
variable.
/A
Copies only source files that have their archive file attributes
set. This switch does not modify the archive file attribute of the
source file.
/M
Copies source files that have their archive file attributes set.
Unlike the /A switch, /M turns off archive file attributes in the
files specified in source.
/D:date
Copies only source files modified on or after the specified date.
Note that the format of date depends on the country settings you are
using.
/P
Prompts for confirmation about whether you want to create each
destination file.
/S
Copies directories and subdirectories, unless they are empty. If
you omit this switch, xcopy works within a single directory.
/E
Copies any subdirectories, even if they are empty.
/V
Verifies each file as it is written to the destination file to make
sure that the destination files are identical to the source files.
/W
Displays the following message and waits for your response before
starting to copy files:
Press any key to begin copying file(s)...
Default value for destination
If you omit destination, the xcopy command copies the files into the
current directory.
Specifying whether destination is a file or directory
If destination does not contain an existing directory and does not end
with a backslash (\), xcopy prompts you with a message in the following
format:
Does destination specify a file name
or directory name on the target
(F = file, D = directory)?_
Xcopy vs. diskcopy
To copy a disk containing files in subdirectories to a disk with a
different format, use xcopy instead of diskcopy. Since diskcopy copies
disks track by track, it requires that the source and destination disks
have the same format. Thus, use xcopy unless you need a complete disk
image copy. However, xcopy will not copy hidden or system files such
as KERNEL.SYS. Therefore, use diskcopy to make copies of system disks.
See Also:
Country
Diskcopy