Copy


With the copy command you can copy one or more files.

Copy from place a to place b
You can specify the location of the file copies by just typing it after the filename:

Example:

C:\>Copy file.txt C:\backup\txt


Result:
This line will copy the file file.txt to the directory C:\backup\txt.

_________________________________________________________/

Wildcard
You can also use wildcards (*) in your command line.

Example:

C:\>Copy A:\*.txt C:\backup\txt


Result:
This line will copy every file with the extension .txt of the directory A:\ to the directory C:\backup\txt.

_________________________________________________________/

Copy under a different name
It is also possible to give the copied files a different name.

Example:

C:\>Copy kaboom.txt C:\billymays\txt\clean.txt


Result:
This line will copy the file kaboom.txt to the directory C:\billymays\txt. It will also change the filename into clean.txt

_________________________________________________________/

Copy con
With copy con you can write a text file without an editor. It is not easy though, because you cannot edit written text after you press the enter key. This is how it works:

- Type copy con

C:\>copy con kaboom.txt


- The DOS prompt is now gone. Now you can type a story.

William Darrell "Billy" Mays, Jr. (July 20, 1958 – June 28, 2009) was
an American television direct-response advertisement salesperson most
notable for promoting OxiClean, Kaboom and other cleaning, homebased,
and maintenance products. His distinctive beard and impassioned sales
pitches made him a recognized television presence in the United States
and Canada. (Wikipedia)


- If you want to save the text, press Ctrl-Z (don't press Ctrl-C or you will lose your written text). When ^Z appears on the screen, press enter.

- Your file is saved!

Sponsors