Index | Notes | Examples
Switches
XCOPY | DISKCOPY



COPY

Copies one or more files to the location you specify. This command can also be used to combine files. When more than one file is copied, MS-DOS displays each filename as the file is copied. Syntax COPY [/Y|/-Y] [/A|/B] source [/A|/B] [+ source [/A|/B] [+ ...]][destination [/A|/B]] [/V] Parameters source Specifies the location and name of a file or set of files from which you want to copy. Source can consist of a drive letter and colon, a directory name, a filename, or a combination. destination Specifies the location and name of a file or set of files to which you want to copy. Destination can consist of a drive letter and colon, a directory name, a filename, or a combination. Switches /Y Indicates that you want COPY to replace existing file(s) without prompting you for confirmation. By default, if you specify an existing file as the destination file, COPY will ask you if you want to overwrite the existing file. (Previous versions of MS-DOS would simply replace the existing file.) If the COPY command is part of a batch file, COPY will behave as in previous versions. Specifying this switch overrides all defaults and the current setting of the COPYCMD environment variable. /-Y Indicates that you want COPY to prompt you for confirmation when replacing an existing file. Specifying this switch overrides all defaults and the current setting of the COPYCMD environment variable. /A Indicates an ASCII text file. When the /A switch precedes the list of filenames on the command line, it applies to all files whose names follow the /A switch, until COPY encounters a /B switch, in which case the /B switch applies to the file whose name precedes the /B switch. When the /A switch follows a filename, it applies to the file whose name precedes the /A switch and to all files whose names follow the /A switch, until COPY encounters a /B switch, in which case the /B switch applies to the file whose name precedes the /B switch. An ASCII text file can use an end-of-file character (CTRL+Z) to indicate the end of the file. When combining files, COPY treats files as ASCII text files by default. /B Indicates a binary file. When the /B switch precedes the list of filenames on the command line, it applies to all files whose names follow the /B switch, until COPY encounters an /A switch, in which case the /A switch applies to the file whose name precedes the /A switch. When the /B switch follows a filename, it applies to the file whose name precedes the /B switch and to all files whose names follow the /B switch, until COPY encounters an /A switch, in which case the /A switch applies to the file whose name precedes the /A switch. The /B switch specifies that the command interpreter is to read the number of bytes specified by the file size in the directory. The /B switch is the default value for COPY unless COPY is combining files. /V Verifies that new files are written correctly. Related Command For information about copying directories and subdirectories, see the <XCOPY> command.
-Top- | Notes | Examples XCOPY | DISKCOPY