DISKCOPY(DOS) UNIX System V DISKCOPY(DOS)
Name
diskcopy - copies the contents of the disk in the source
drive to the disk in the target drive
Syntax
diskcopy [drive:] [drive:]
Description
The first drive: option is the source drive. The second
drive: option is the target drive.
If you omit both options, MS-DOS performs a single-drive
copy operation on the default drive. If you omit just the
second option, MS-DOS uses the default drive as the target
drive. In either case, though, diskcopy destroys the
contents of the target disk.
diskcopy prompts you to insert the source and target disks
at appropriate times and waits for you to press any key
before continuing.
After copying, diskcopy then prompts you with the following
message:
Copy another diskette (Y/N)?_
If you press y, MS-DOS prompts you to insert source and
target disks, and performs the next copy on the drives that
you originally specified.
To end the diskcopy process, press n.
Because disk space is not allocated sequentially, disks that
have had a lot of files created and deleted on them become
fragmented. So, the first free sector found by diskcopy
becomes the next sector allocated, regardless of its
location on the disk.
A fragmented disk can delay finding, reading, or writing a
file. To prevent further fragmentation, you should use
either copy or xcopy to copy your disk, instead of using
diskcopy. Because copy and xcopy copy files sequentially to
a disk, the new disk will not be fragmented.
The following command, for example, copies all files from
the disk in drive A to the disk in drive B:
xcopy a:*.* b:
diskcopy figures out the number of sides to copy, based on
the source drive and disk.
diskcopy exit codes
When correctly written programs exit back to MS-DOS, they
return an exit code: 0 if no error occurred, or a value
greater than zero if there was a problem. This exit code
can be tested in batch files, and it allows batch
programmers to ``branch'' to an error-handling routine in
the batch file.
0 Copied successfully
1 Non-fatal read/write error An unrecoverable but non-
fatal read or write error
occurred.
2 CONTROL-C error The user entered <CTL>c to
terminate diskcopy.
3 Fatal hard error diskcopy was unable to read
the source disk or format
the target disk.
4 Initialization error There is not enough memory
- invalid drives or command
line syntax.
You can use the batch processing if command to perform error
processing based on the errorlevel returned by diskcopy.
Example
To copy the disk in drive A to the disk in drive B, enter
the following command:
diskcopy a: b:
diskcopy prompts you to insert both disks and press any key
to begin copying.
Notes
diskcopy is an external command.
DISKCOPY(DOS) (printed 8/16/89) DISKCOPY(DOS)