appending to files via the command line

  • Thread starter Thread starter yawnmoth
  • Start date Start date
Y

yawnmoth

I have a scheduled task (a batch file) that's supposed to run everyday
at 6am and I'd like to sorta to have it create a log file. eg. when it
runs on May 10th, I'd like it to append something like "ran on May 10"
to the log file. On May 11th, I'd want it to append May 11th,
resulting in a log file that looks something like...

ran on May 10
ran on May 11
....etc...

Using > doesn't work as the following demonstrates:

echo test > log.txt
echo test2 > log.txt

At this point, log.txt simply says test2 - not test / test2.
 
Try double > characters. >> As I recall, that causes it to append, rather than overwrite.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top