Tech Support Section Home Mekong Network Home
About This Site...
Mekong.Net Sites...
Recently Updated...
Recommended Links...
Contact Us...
Questions? Comments? Requests? Click here to contact us.

How Can I Create A File From The Command Line?

If you want to create and save the file without ever leaving the command line, you can use the "copy con" command:

copy con filename.txt

(Of course, you can substitute your desired filename in place of "filename.txt".) The cursor will drop down to the next line. Hit "enter" to begin creating the file. Anything you type from that point on will be entered into the file. Hit "control z" when you are done entering text. Hit enter to return to the command prompt.

If you want to make a totally empty file with no muss and no fuss, you can do it with touch.exe. Touch.exe is a DOS version of a common UNIX utility, used to timestamp files. But it can also be used to create a file if the file doesn't already exist. For example:

touch yournose.txt

This command would create an empty file called yournose.txt. (Naturally, that works on UNIX and Linux, too!) There are actually a bunch of other ways, too, I'm sure, but seriously, how many different ways do you NEED to be able to make a file full of nothing?