XCOPY

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In computing, Xcopy is a command used on PC DOS, MS-DOS, OS/2, Microsoft Windows, and related operating systems for copying multiple files or entire directory trees from one directory to another and for copying files across a network. Xcopy stands for extended copy,[1] and was created as a more functional file copying utility than the copy command found in these operating systems.

Contents

[edit] Example

Create a new directory by copying the contents of the existing directory, including any files or subdirectories having the "hidden" or "system" attributes and empty directories.

xcopy e:\existing e:\newcopy /s /e /i /h

If the directory names include blank signs(spaces), the names can be put in quotation marks.

xcopy "D:\Documents and Settings\MY.USERNAME\My Documents\*" "E:\MYBACKUP\My Documents\" /D/E/C/Y

Copy entire drive in to a mapped network drive while ignoring any errors in network restartable mode.

xcopy *.* z:\Netmirror /E /V /C /F /H /Y /Z  1>out.txt 2>err.txt

Copy a single file without prompt if it is a file or a directory

cmd /c echo F | xcopy "c:\directory 1\myfile" "c:\directory 2\myfile"

[edit] Deprecation

While still included in Windows Vista, Xcopy has been deprecated in favor of Robocopy, a more powerful copy tool, which is now built into the operating system.[2] Windows 7 xcopy /? does not claim that it is deprecated.

[edit] Limitation

Experience has shown (e.g., http://www.terminally-incoherent.com/blog/2007/02/05/xcopy-insufficient-memory/) that Xcopy fails with an "insufficient memory" error when the path plus filename is longer than 254 characters. Robocopy does not have this limitation.

[edit] See also

[edit] References

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages