So who's smart with Batch files?

PhreakyMike

Member
Apr 2, 2005
59
0
0
Arrgh, I have a problem, this is probably a joke for some, but for the less skilled it's a pain in the GPU.

I'm in my first year Networking, and we're learning how to make batch files!! (yay). Anyways, I need to write a batch to write my name to a text file. Now, I know there's EDIT C:\TEXT.TXT but when I do that, it'll open up the text program in the stupid blue edit screen.

I need something like this:

edit c:\text.txt
Hello My name is Mike
some sort of exit command

now if I do edit c:/text.txt I wanna see 'Hello my name is Mike" on the first line.

Pls help all you expert programmers lol, you were all where I was once...

If you help me and buy something from me too, I'll ship you out a cookie :D
 

CTweak

Senior member
Jun 6, 2000
451
0
0
I should add the avove command will overwrite C:\WHATEVER.TXT

If you want to append to the end of C:\WHATEVER.TXT use ..

echo "Whatever text you want" >> C:\WHATEVER.TXT
 

CTweak

Senior member
Jun 6, 2000
451
0
0
No prob, I haven't thought about BAT files since my LanTastic days - lot's of very complex ones to control logins/outs, etc. It was actually fun ...