This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
|Developer(s)||Microsoft, IBM, Rene Ableidinger, ReactOS Contributors|
|Initial release||1986, 32–33 years ago|
|Operating system||DOS, OS/2, Microsoft Windows, ReactOS|
In computing, XCOPY is a command used on IBM PC DOS, MS-DOS, FreeDOS, OS/2, Microsoft Windows, ReactOS, 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, and was created as a more functional file copying utility than the copy command found in these operating systems. XCOPY first appeared in DOS 3.2.
Create a new directory by copying all contents of the existing directory, including any files or subdirectories having the "hidden" or "system" attributes and empty directories.
xcopy e:\existing e:\newcopy /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"
Xcopy fails with an "insufficient memory" error when the path plus filename is longer than 254 characters and moving large files without the "/j" option (available only after Server 2008R2) can consume all available RAM on a system.
No open files
Xcopy will not copy open files. Any process may open files for exclusive read access by withholding the FILE_SHARE_READ https://msdn.microsoft.com/en-us/library/aa363858.aspx
The Windows Volume Shadow Copy service is used for such situations, but Xcopy does not use it. Therefore, Xcopy is not useful for backing up live operating system volumes.
- "Windows NT File System Files". Microsoft Help and Support. Microsoft. 2006-11-01.
- Pietrek, Matt (2007-01-16). "Robocopy built into Vista". Under The Hood (an MSDN blog).
- Maciak, Luke (2007-02-05). "Xcopy: Insufficient Memory".
- "Technet: Xcopy". 2014-03-07.
- Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
- John Paul Mueller (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. John Wiley & Sons. ISBN 978-0470165799.
|Wikibooks has a book on the topic of: Guide to Windows Commands|
- Switches That You Can Use with Xcopy and Xcopy32 Commands, Windows 95, Windows 98, Windows Me
- Xcopy, Microsoft Windows XP
- Microsoft TechNet Xcopy article
- VariableGHz article depicting CRC errors and XCOPY as a solution
- XCOPY Command in a post build event does not execute
- XP_CMDSHELL Does Not Work with XCOPY
- See also Microsoft Product Documentation