creating a file from the command line

Is there any way to create a text (or any) file from the Windows command line? Suppose I wanted a text file located in C:\ called "file.txt" which contains the text "TEXT". I'm thinking of a command similar to this:

create C:\file.txt "TEXT"

Is there any functionality similar to this?
[308 byte] By [HighCommander4] at [2007-11-20 8:34:48]
# 1 Re: creating a file from the command line
Try...

echo This will show up in the text file > c:\file.txt
PeejAvery at 2007-11-10 3:40:01 >
# 2 Re: creating a file from the command line
Or good old copy con C:\file.txt, enter - type the text - finish with ctrl-z & enter
S_M_A at 2007-11-10 3:41:01 >
# 3 Re: creating a file from the command line
I thought of that first but that requires user input. The way HighCommander4 describes it is without user input.
PeejAvery at 2007-11-10 3:42:00 >
# 4 Re: creating a file from the command line
Oh, didn't realize that! You're probably right. This is intended for a batch file I guess.
S_M_A at 2007-11-10 3:43:05 >
# 5 Re: creating a file from the command line
Thank you PeejAvery, your solution works. (It is indeed for a batch file.)

What if my text has a enter (linefeed) in it? I need to be able to do it in one command...

EDIT: Scratch that, I can do it in multiple commands? But how *do* you make a second echo append the text to the already existing file rather than overwriting it?
HighCommander4 at 2007-11-10 3:44:04 >
# 6 Re: creating a file from the command line
To append use >> instead of >.
PeejAvery at 2007-11-10 3:45:08 >
# 7 Re: creating a file from the command line
Thank you once again PeejAvery! I got it to work now. :thumb:
HighCommander4 at 2007-11-10 3:46:12 >
# 8 Re: creating a file from the command line
Glad to be of help! And thanks for the rate! :wave:
PeejAvery at 2007-11-10 3:47:07 >