subscribe: Posts | Comments

Dos COPY Command

Comments Off

The COPY command can be used both to copy files from disk to disk or to create a second copy of a file on a single disk. (There are many more uses of the COPY command, but only the basic operation is discussed here.)

Example:

•C> copy c:kermit.exe a:
•Copies the file ‘KERMIT.EXE’ from the C drive to the A drive and gives it the same name.
•C> copy a:brazil1.dat b:\south\brazil2.dat
•Creates a copy of ‘BRAZIL1.DAT’ from drive A on drive B, putting it in the ‘SOUTH’ subdirectory and renaming it ‘BRAZIL2.DAT’.

The key to use this command correctly is to remember that the first file specified after the COPY command is the source file, the second is the target:ehp1 file. The source is the file to be copied. The target will be the location and name of the new file. If the file name and extension are omitted after the target’s drive specification, the new file will have exactly the same name as the source file.

Example:

•C> copy a:myfile.txt b:
•C> copy c:command.com b:com.com
•C> copy b:golly.gee a:whao.boy
•C> copy command.* a:
•C> copy a:mymap.dwg c:\maps
Note: it is always good practice to us the complete file specifications for both source and target files, Be very sure of yourself before you accept defaults or employ wild-card characters. Otherwise you may end up with some interesting results. Incomplete or incorrect source names may result in errors, such as the command: copy edlin a:myomy.bat. Try it and see what happens.