Back to Blog
Arnošt Havelka

Copy Con Command

Create simple text files directly from the command line.

Start Interactive Lesson
Copy Con Command

Copy Con Command

copy con is a classic trick for creating short text files directly in the terminal without opening a text editor like Notepad. "Con" stands for "Console", so you are literally copying from the console input to a file.

Usage:copy con
[filename]
F6 or Ctrl+Z
Press this after typing your text to save the file.
Enter
Press Enter to move to a new line while typing.

How to Use It

  1. Type copy con <filename>.
  2. Press Enter.
  3. Type your text. You can use multiple lines.
  4. When finished, press F6 or Ctrl+Z. You will see ^Z appear.
  5. Press Enter to save the file.

Note: You cannot edit previous lines once you've pressed Enter. This is strictly for quick, one-off file creation.

Real-World Examples

1. Creating a simple batch file

Quickly create a script to automate a task.

Command Prompt
C:\Users\User>copy con hello.bat

2. Creating a To-Do list

Jot down a few items rapidly.

Command Prompt
C:\Users\User>copy con todo.txt

Knowledge Check

1 / 3

What does 'con' stand for?

References

These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.