Zibbobz
Zibbobz

Reputation: 755

Can I add a log write to my batch file?

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?

Upvotes: 0

Views: 538

Answers (2)

Magoo
Magoo

Reputation: 79983

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.

Upvotes: 2

SLaks
SLaks

Reputation: 887365

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.

Upvotes: 1

Related Questions