Computing.Net > Forums > Programming > Bat - write to txt

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Bat - write to txt

Reply to Message Icon

Name: Code One
Date: January 14, 2004 at 14:35:02 Pacific
OS: me
CPU/Ram: pent3-256mb
Comment:

hello,
how do i set up a bat file to take a block of text (pre-written in the bat file), save it as a .txt file and place it in a folder i premade?

for example:

I would like to take some text like so:
::---------------
::
:test
cls
echo hello
echo my name is...
echo ummm....
echo oh yeah..
echo code one
pause
goto blah
::
::----------

Then have that text which is my bat file, copyied to a txt file, or atleast saved as a txt file.

And that file would be saved in a folder, uh lets call it... C:\MYDOCU~1\CodeOne

any help is appreciated..

code one



Sponsored Link
Ads by Google

Response Number 1
Name: Code One
Date: January 14, 2004 at 15:19:46 Pacific
Reply:

nevermind figured it out...

thanks

code one


0

Response Number 2
Name: malu05
Date: January 15, 2004 at 15:52:45 Pacific
Reply:

For Others that like to know


Echo Hej MEd Dig > Mads.txt

or makeing a timer so you can se when the program was runned


Echo %Date% %Timer% > Mads.txt


0

Response Number 3
Name: Code One
Date: January 16, 2004 at 19:39:03 Pacific
Reply:

for my own quick reference this is what I do:

set str1=
echo %str1% hello >C:\windows\desktopmyText.txt


-----
the text file has to be existant, anything pre-written in the file is overwritten, to have a line break you would code it like this:
set str1=
echo %str1%Hello > C:\windows\desktop\myText.txt
set str2=
echo %str2%good bye >>C:\windows\desktop\myText.txt

sweet!


(maybe wrong syntax, will post the correct if wrong)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Bat - write to txt

Bat file to serarch a word in txt www.computing.net/answers/programming/bat-file-to-serarch-a-word-in-txt/17976.html

Bat file to check for file with current date www.computing.net/answers/programming/bat-file-to-check-for-file-with-current-date/18823.html

Write to file noob question www.computing.net/answers/programming/write-to-file-noob-question/13381.html