• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 998
  • Last Modified:

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

0
gisvpn
Asked:
gisvpn
1 Solution
 
xassetsCommented:
What about this

echo mystring >> log.txt

??
0
 
mokuleCommented:
and this
date /T >> log.txt
time /T >> log.txt
0
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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
 
xassetsCommented:
oops

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

been doing too much vb obviously
0
 
KavarCommented:
yeah what xassets said :)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now