Top Qs
Timeline
Chat
Perspective
XCOPY
Shell command for copying files From Wikipedia, the free encyclopedia
Remove ads
XCOPY
(short for extended copy[1]) is a shell command for copying files and directory trees from one directory to another or across networks. The command was designed to be more functional than the copy
command; but to augment it instead of replacing it.
Remove ads
The command first appeared in DOS 3.2.[2] The command is available on IBM PC DOS, MS-DOS, OS/2,[3] Windows,[4] FreeDOS,[5] ReactOS,[6] and other systems. DR DOS 6.0[7] and ROM-DOS[8] include an implementation of the XCOPY
command. The FreeDOS version was developed by Rene Ableidinger and is licensed under the GPL.[9] The ReactOS version was developed J. Edmeades and is licensed under the LGPL.[10]
While still included in Windows 10, XCOPY
is deprecated in favor of robocopy
which is now supplied with Windows Server and Desktop operating systems.[11]
Remove ads
Compression
Since Windows Server 2019 and Windows 10, a compression
option is available in xcopy
when copying across a network. With this switch, if the destination computer supports SMB compression and the files being copied are very compressible, there may be significant improvements to performance. The SMB compression adds inline whitespace compression to file transfers. Compression is also available with the robocopy
command and Hyper-V Live Migration with SMB.[12][13]
Remove ads
Example
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 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 /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"
Remove ads
Limitations
XCOPY
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.
No open files
XCOPY
will not copy open files. Any process may open files for exclusive read access by withholding the FILE_SHARE_READ
[16]
XCOPY
does not support the Windows Volume Shadow Copy service which effectively allows processes to have access to open files, so it is not useful for backing up live operating system volumes.
XCOPY deployment
XCOPY deployment or xcopy installation is a software application's installation into a Microsoft Windows system simply by copying files. The name is derived from the XCOPY
command line facility provided by Microsoft operating systems.
In contrast, the installation of a typical Windows application will require a significant number of additional steps before the application is ready to be used. Most of this additional work involves, directly or indirectly, adding or modifying entries in the Windows Registry. Even when an application uses ordinary files for its own data, many common facilities provided by Windows require some type of registration step before they are available to programs. Usually, one or more specialized tools (such as Windows Installer, InnoSetup, or NSIS) are used to help coordinate these relatively complex operations.
Remove ads
See also
References
Further reading
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads