How to create a file in windows cmd?
1 answer(s)
Answer # 1 #
Creating a file is quite simple, actually. The easiest method is to use the echo
command. Just open your Command Prompt and type echo. > MyNewFile.txt
. This will instantly create an empty text file for you in the current directory.
Another very popular command is type nul > AnotherFile.txt
. This also does the same thing, creating a zero-byte file. It's a classic trick, you see.
If you want to add text immediately, use copy con MyFileWithText.txt
. After typing this, you can write your content directly. When you are finished, just press Ctrl+Z and then hit Enter to save the file. Hope this helps you out