Search notes:

xcopy.exe

An extended copy utility.
xcopy p:\ath\to\source\directory                                 [ options ]
xcopy p:\ath\to\source\directory p:\ath\to\destination\directory [ options ]

Command line arguments (options)

/A / /M Copy only files with archive attribute set. /A: don't change the attribute, /M reset archvie attribte
/D:m-d-y Don't copy files that were modified before 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. Each string should be in a separate line in the files. 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.
/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.
/V Verify size of each new file.
/C Continues copying even if errors occur.
/P Prompt before creating a destination file.
/W Prompts you to press a key before copying.
/I If destination does not exist and copying more than one file, assumes that destination must be a directory.
/Q Quiet: display file names while copying.
/F Display full source and destination file names while copying.
/L Display files that would be copied.
/G Allows the copying of encrypted files to destination that does not support encryption.
/H Copy hidden and system files also.
/R Overwrite read-only files.
/T Create directory structure without copying files. Without /E, empty directories and subdirectories are not created.
/U Copy only files that already exist in destination.
/K Copy attributes. Normal Xcopy will reset read-only attributes.
/N Copy using the generated short names.
/O Copy file ownership and ACL information.
/X Copy file audit settings (implies /O).
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.
/-Y Causes prompting to confirm you want to overwrite an existing destination file.
/Z Copy networked files in restartable mode.
/B Copy the Symbolic Link itself versus the target of the link.
/J Copy using unbuffered I/O. Recommended for very large files.
The /Y flag may also be set via the COPYCMD environment variable (in which case it can be overwritten with -Y).

Copying a directory including sub directories

An entire directory can be copied with
xcopy p:\ath\to\source\directory p:\ath\to\destination\directory /s /e /i

See also

The cmd.exe built-in command copy and Robocopy.exe

Index