Copy con

Copy con is an MS-DOS and Windows command line command that allows the creation of a file through the command prompt. To use this command type copy con followed by the name of the file you want to create as shown below.

copy con myfile.txt

After this command is typed you'll be returned to a blank line, which is the start of your file. Enter the lines you want to insert into the file and when done press Ctrl + Z to create the file. If you want to cancel the creation of the file press Ctrl + C.

Tip: Although this is a fast way to create a small file, if you need to edit a file or work on something larger, we suggest typing notepad myfile.txt, which opens that file or creates a new file in Windows Notepad.

  • See the copy command page for further information about the MS-DOS and Windows command line copy command.

Also see: Copy