COPY + Copying Files
Copies, renames, and concatenates (combines) files.
PC-DOS 2.0+ (revised from 1.0)
MS-DOS equivalent: COPY (2.0+)
To copy files with the same or different names:
COPY [B] [sd:][spath]sfilename [B]
To copy and combine files:
COPY [B] [sd:][spath]sfilename [B]
[+[cd:][cpath]cfilename [B] . . .]
/A or /B Indicates whether the
preceding file and all
subsequent files are to be
read as ASCII (text) or binary
files, and it is in effect
until further modified.
[sd:][spath]sfilename Specifies source file or files
to be copied.
(source)/A Causes the file to be treated
as a text SCII) file (read
only to the ^Z mark).
(source)/B Causes the entire file to be
copied based on the size
indicated in the directory (as
a binary file).
[td:][tpath]tfilename Specifies target file or files
to be copied to. The tFilename
is specified if you wish to
rename the target file during
(target)/A Adds a ^Z (end of file) as the
last character in an ASCII
(target)/B Causes no ^Z to be added to
the end of a binary target
+[cd:][cpath]cfilename Specifies file(s) to be
combined with source file
/V Tells DOS to verify that the
target file is correct.
COPY is used to make copies from one disk to another, to
duplicate a file on the same disk, to read or write to or from
external devices, and to combine files.
COPY C:\TEST.FIL C:\DOS
copies TEST.FIL from the root directory to the subdirectory named
DOS (if this subdirectory exists).
COPY C:\TEST.FIL C:\DOS\NEW.FIL
copies TEST.FIL from the root directory into the subdirectory
DOS, naming the copy NEW.FIL.
COPY A:*.* B:
copies all the files from the current directory on the disk in
drive A to a disk in drive B, using their same file names.
COPY TEST.FIL COM1
sends the contents of TEST.FIL to COM1.
COPY CON: QUICK.FIL
sends whatever you type at the keyboard to a file named
QUICK.FIL. To end the file, press Ctrl-Z and Return.
COPY TEST.FIL + NEW.FIL TEST2.FIL
concatenates TEST.FIL and NEW.FIL into TEST2.FIL.
COPY TEST.FIL + NEW.FIL
concatenates TEST.FIL and NEW.FIL under the name TEST.FIL.
COPY TEST.FIL TEST2.FIL /V
makes another copy of TEST.FIL under the name TEST2.FIL, and
verifies that the copy is correct.
Cannot do binary reads from a device
The /B option was used while attempting to copy from a system
device. Omit the /B and retry.
File cannot be copied onto itself
You tried to make a copy of a file on the same disk without
changing its name. Specify a new file name and retry.
File not found
The file does not exist or there is an error in the way its name
Invalid path or name
The path or file name that was specified does not exist.
Repeat the COPY command using correct drive/directory and/or
file name parameters. If you renamed the file during the copy, be
sure to use the new file name when repeating the COPY command.
Also, delete the unwanted copy.
If a target file name is not specified, the source file name
is used. If there is more than one source file, as in a
concatenation, the name of the first source file is used.
Wildcards may be used. Device names may be used in place of file
The /A and /B options are seldom used; when they are, it is
to distinguish between ASCII (text) and binary files that contain
special nontext characters, such as program files and database
files. When concatenating files, /A is the default; otherwise, /B
is the default.
[For related topics, press R]
DEL (DELETE) and ERASE Commands
ECHO batch file command
RENAME EN) Command
|file: /Techref/dos/command/copy.htm, 5KB, , updated: 2004/1/1 14:51, local time: 2018/7/21 03:09,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/dos/command/copy.htm"> dos command copy</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180721 RussellMc, Van Horn, David, Sean Breheny, David C Brown, Isaac M. Bavaresco, Bob Blick, Neil, Denny Esterline, John Gardner, Brent Brown,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!