Batch file to add string to a TEXT file

Hello i would like a batch file which when run will insert a little bit of text and the current time and date..

If possible i would like this to append to any other text already in the text file and have a break on each insert of text.

The name of the text file is log.txt

Many thanks

Ollie

gisvpnAsked:
Who is Participating?
 
xassetsCommented:
oops

echo %date% %time% string >> log.txt

been doing too much vb obviously
0
 
xassetsCommented:
What about this

echo mystring >> log.txt

??
0
 
mokuleCommented:
and this
date /T >> log.txt
time /T >> log.txt
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
gisvpnAuthor Commented:
Thanks,

I have used the following in a single batch file.

date /T >> log.txt
time /T >> log.txt
echo MS04-007 >> log.txt
echo -END- >> log.txt


The output in the file is

Wed 24/03/2004
18:41
MS04-007
-END-

Can i get this all on one line ?????

Thanks
0
 
KavarCommented:
@echo *******************>>c:\testfile.txt
time /t >>c:\testfile.txt
@echo *******************>>c:\testfile.txt
0
 
xassetsCommented:
no, its

each %date% %time% string >> log.txt
0
 
KavarCommented:
yeah what xassets said :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.