XCOPY
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, Xcopy is a command
Command (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....

 used on PC DOS, MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...

, OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

, Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, and related operating systems for copying multiple files
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...

 or entire directory trees from one directory
Directory (file systems)
In computing, a folder, directory, catalog, or drawer, is a virtual container originally derived from an earlier Object-oriented programming concept by the same name within a digital file system, in which groups of computer files and other folders can be kept and organized.A typical file system may...

 to another and for copying files across a network
Computer network
A computer network, often simply referred to as a network, is a collection of hardware components and computers interconnected by communication channels that allow sharing of resources and information....

. Xcopy stands for extended copy, and was created as a more functional file copying utility than the copy
Copy (command)
In computing, copy is a command in RT-11, RSX-11, OpenVMS, DOS, OS/2 and Microsoft Windows operating systems. The command copies computer files from one directory to another. The destination defaults to the current working directory. If more than one source file is indicated, the destination must...

 command found in these operating systems.

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"

Deprecation

While still included in Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

, Xcopy has been deprecated in favor of Robocopy
Robocopy
Robocopy, or "Robust File Copy", is a command-line directory replication command. It has been available as part of the Windows Resource Kit starting with Windows NT 4.0, and was introduced as a standard feature of Windows Vista, Windows 7 and Windows Server 2008...

, a more powerful copy tool, which is now built into the operating system. Windows 7 xcopy /? does not claim that it is depreciated.

Limitation

Xcopy fails with insufficient memory when the path plus filename is longer than 254 characters. Robocopy does not have this limitation.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK