0

As this question points out Appending output of a Batch file To log file I can write to a log file when running a batch job simply by using the pipe command ">".

However, what I'd really like to do is have the job write to my log file automatically - without having to run it from console (So that I can just double-click it when I want to run a build). Is there a way to do this?

Zibbobz
  • 715
  • 1
  • 13
  • 37

2 Answers2

2

Right-click the shortcut and select properties. Change the target by appending >logfilename to create a new logfile, or >>logfilename to append to any existing logfile. Click Apply, and you're done.

Magoo
  • 72,034
  • 7
  • 58
  • 78
1

You can redirect every command within the batch file to a log.

Or you can make a wrapper batch file that calls the original and redirects it.

SLaks
  • 837,282
  • 173
  • 1,862
  • 1,933