|
XCOPY
Copies files from one or more subdirectories. Slightly more
powerful than COPY. XCOPY has all the same functions as COPY
but these switches also available:
/D:m-d-y Copies files changed on or after the specified
date. If no date is given, copies only those
files whose source time is newer than the
destination time.
/EXCLUDE:file1[+file2][+file3]... Specifies a list of files
containing strings. When
any of the strings match
any part of the absolute
path of the file to be
copied, that file will be
excluded from being
copied. For example,
specifying a string like
\obj\ or .obj will
exclude all files
underneath the directory
obj or all files with the
.obj extension
respectively.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty
ones.
/E Copies directories and subdirectories, including
empty ones. Same as /S /E. May be used to modify /T.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than
one file, assumes that destination must be a
directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names
while copying.
/L Displays files that would be copied.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy
files. Does not include empty directories or
subdirectories. /T /E includes empty directories and
subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only
attributes.
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
Examples
To copy all the files and subdirectories (including any
empty subdirectories) from drive A to drive B, type:
XCOPY a: b: /s /e
To include any system or hidden files in the previous
example, add the/h command-line option as follows:
XCOPY a: b: /s /e /h
Batch File Commands
|