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 Answer
As npocmaka posted in his comment, you can redirect the output of any command executed into a text file.
echo 123>log.txtwill write 123 into the file log.txt. The file will be overwritten.echo 123>>log.txtwill 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.txtand usecommand>>log.txt. This way you will always have a "fresh" log file containing the log for one full execution of your script.
some command>>logfile.txt?