0

Im quite new to using bat files as a script. I'm doing this in windows and I'm wondering if theres an easy to way to out the contents of the console to an output log??? Thanks

1
  • 2
    some command>>logfile.txt ? Commented Feb 17, 2016 at 5:01

1 Answer 1

1

As npocmaka posted in his comment, you can redirect the output of any command executed into a text file.

  • echo 123>log.txt will write 123 into the file log.txt. The file will be overwritten.

  • echo 123>>log.txt will append 123 at the end of the text file.

  • If you want to overwrite an existing log file at the beginning of your script, you should start with type nul>log.txt and use command>>log.txt. This way you will always have a "fresh" log file containing the log for one full execution of your script.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.