Just learned, for everyone's reference and study:
There are two usages of copy con.
1. Create a new file
copy con filename
After entering this command and pressing Enter, you enter the editing state. Enter the required content on the screen. After entering, press <Ctrl>+Z to end the editing, and the system automatically saves it.
This command can be used for simple text editing, but it can only create new files. If there is a file with the same name in the current specified path, it will be overwritten (if you want to edit the old file, please use EDIT).
2. Display file content (equivalent to TYPE)
copy filename con
Then the content of the specified file will be displayed on the screen.
In DOS, some devices appear in the form of special file names, such as CON (screen), PRN (printer), etc. They can be used in combination with COPY and other commands to complete many special tasks.