From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Developer(s)Microsoft, IBM, Rene Ableidinger, ReactOS Contributors
Initial release1986, 32–33 years ago
Operating systemDOS, OS/2, Microsoft Windows, ReactOS

In computing, XCOPY is a command used on IBM PC DOS, MS-DOS, FreeDOS,[1] OS/2, Microsoft Windows,[2] ReactOS,[3] 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,[4] 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.

The FreeDOS version was developed by Rene Ableidinger.[5]


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"


While still included in Windows 10, Xcopy has been deprecated in favor of Robocopy, a more powerful copy tool, which is now built into the Microsoft Windows Server and Desktop operating systems.[6]


Xcopy fails with an "insufficient memory" error when the path plus filename is longer than 254 characters[7] and moving large files without the "/j" option (available only after Server 2008R2) can consume all available RAM on a system.[8]

No open files[edit]

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.

See also[edit]


  1. ^ http://freedos-project.blogspot.com/2018/06/freedos-commands-quick-reference.html
  2. ^ Xcopy
  3. ^ https://github.com/reactos/reactos/tree/master/base/applications/cmdutils/xcopy
  4. ^ "Windows NT File System Files". Microsoft Help and Support. Microsoft. 2006-11-01.
  5. ^ http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/xcopy.html
  6. ^ Pietrek, Matt (2007-01-16). "Robocopy built into Vista". Under The Hood (an MSDN blog).
  7. ^ Maciak, Luke (2007-02-05). "Xcopy: Insufficient Memory".
  8. ^ "Technet: Xcopy". 2014-03-07.

Further reading[edit]

External links[edit]