XCOPY : One of the useful command in DOS

I was aware of XCOPY command, but didn't know all the available parameters that I can use with that command.

I found a good link that describes each parameter in detail. Here is an abstract from that site, scroll down to view the original URL for XCOPY command.


Copy files and/or directory trees to another folder. XCOPY is similar to the COPY command except that it has additional switches to specify both the source and destination in detail.

XCOPY is particularly useful when copying files from CDROM to a hard drive, as it will automatically remove the read-only attribute.

XCOPY <em>source</em> [<em>destination</em>] [<em>options</em>]

source : Pathname for the file(s) to be copied.

destination : Pathname for the new file(s).

[options] can be any combination of the following:

<i> Source Options</i>

/A Copy files with the archive attribute set (default=Y)

/M Copy files with the archive attribute set and
turn off the archive attribute, use this option
when making regular Backups (default=Y)

/H Copy hidden and system files and folders (default=N)

Copy files that have changed since mm-dd-yyyy.
If no date is given, the default is to copy
files with a modification date before today.
(at least 1 day before)

/U Copy only files that already exist in destination.

/S Copy folders and subfolders

/E Copy folders and subfolders, including Empty folders.
May be used to modify /T.


(Windows 2000 only) The files can each contain one
or more full or partial pathnames to be excluded.
When any of these match any part of the absolute path
of a SOURCE file, then that file will be excluded.
For example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
Copy Options</i>

/W Prompt you to press a key before starting to copy.
/P Prompt before creating each file.

/Y (Windows 2000 only) Suppress prompt to confirm overwriting a file.
may be preset in the COPYCMD env variable.
/-Y (Windows 2000 only) Prompt to confirm overwriting a file.

/V <a href="http://ss64.com/nt/verify.html">Verify</a> that the new files were written correctly.
/C Continue copying even if an error occurs.

/I If in doubt always assume the destination is a folder
e.g. when the destination does not exist.

/Z Copy files in restartable mode. If the copy is interrupted part
way through, it will restart if possible. (use on slow networks)

/Q Do not display file names while copying.
/F Display full source and destination file names while copying.
/L List only - Display files that would be copied.

<i> Destination Options</i>

/R Overwrite read-only files.

/T Create folder structure, but do not copy files. Do not
include empty folders or subfolders.
/T /E will include empty folders and subfolders.

/K Copy attributes. XCOPY will otherwise reset read-only attributes.

/N If at all possible, use only a short filename (8.3) when creating
a destination file. This may be nececcary when copying between disks
that are formatted differently e.g NTFS and VFAT, or when archiving
data to an ISO9660 CDROM.

/O (Windows 2000 only) copy file Ownership and ACL information.

/X Copy file audit settings (implies /O).

Click <a target="_blank" href="http://bit.ly/af94Kx">here</a> to visit the original site for more details OR
Copy and Paste the below URL in your browser
<a target="_blank" href="http://ss64.com/nt/xcopy.html">http://ss64.com/nt/ xcopy.ht ml</a>

No comments:

Post a Comment