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
  • 725
  • 1
  • 15
  • 41

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
  • 77,302
  • 8
  • 62
  • 84
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
  • 868,454
  • 176
  • 1,908
  • 1,964