| XCOPY | |
|---|---|
TheReactOS xcopy command | |
| Developers | Microsoft,IBM,DR,Datalight,Novell, Rene Ableidinger, ReactOS Contributors |
| Initial release | 1986, 38–39 years ago |
| Operating system | MS-DOS,PC DOS,MSX-DOS,SISNE plus,OS/2,eComStation,ArcaOS,Windows,DR DOS,ROM-DOS,FreeDOS,ReactOS |
| Type | Command |
| License | FreeDOS:GPL ReactOS:LGPL Others: Proprietary |
| Website | docs |
XCOPY is ashellcommand forcopyingfiles and directory trees from onedirectory to another or acrossnetworks. The command was designed to be more functional than thecopy command; but to augment it instead of replacing it.
The name, short for extendedcopy,[1] is often written asXCOPY orxcopy. As was the prevailing style forDOS systems, the name was typically written in all caps when DOS was a prevalent technology and even today in the context of such obsolete systems. In modern times and for modern systems, prevailing style is to write command names in lower case. Since the command's use spans from DOS to current systems, both representations are commonly used.
The command first appeared in DOS 3.2.[2] The command is available onIBM PC DOS,MS-DOS,OS/2,[3]Windows,[4]FreeDOS,[5]ReactOS,[6] and other systems.DR DOS 6.0[7] andROM-DOS[8] include an implementation of theXCOPY command. TheFreeDOS version was developed by Rene Ableidinger and is licensed under theGPL.[9] TheReactOS version was developed J. Edmeades and is licensed under theLGPL.[10]
As stated by the command that ships withVista (reported viaxcopy /?), Microsoftdeprecatedxcopy in favor ofrobocopy.[11] But, since the version in thecurrent release of Windows does not state this and the command is still available in Windows long after Vista was released in 2007, deprecation may have been reversed.
SinceWindows Server 2019 andWindows 10, the command supports a/compress option to optimize throughput across a network. With this option enabled, if the destination computer supportsServer Message Block (SMB) compression and the files are very compressible (i.e. not already compressed), there may be significant improvements to performance.[12][13]
xcopy deployment orxcopy installation describes installing anapplication via the relatively simply operation of copying files – either usingxcopy or another file copying facility. In contrast, many Windows application installations include additional and more complicated operations such as modifying theWindows Registry. Even when an application is implemented using files (that can be installed via a copy operation), many common facilities provided by Windows require registration before they are available to an application. Often, specialized installation tools (such asWindows Installer,InnoSetup,InstallShield, andNSIS) are used to coordinate these relatively complex operations.
The command fails with an "insufficient memory" error when the path plus filename is longer than 254 characters.[14] An option "/J" copies files without buffering;[15]moving very large files without the option (available only after Server 2008R2) can consume all available RAM on a system.
The command will not copy files that are being held open by another process.[16] The command does not support the Windows VolumeShadow Copy service which allows processes to access open files. Therefore, the command is not useful for backing up live systems.
Create a new directory by copying all contents of the existing directory, including any files or subdirectories having thehidden orsystem attributes and empty directories.
>xcopy e:\existing e:\newcopy /e /i /hIf the pathnames include spaces, they must be enclosed 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 /Z1>out.txt2>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 /? in Windows 10 includes "/COMPRESS - Request network compression during file transfer where applicable".