How to capture the output of a script if it is being ran by the task scheduler

batch-filescheduled-tasks

Using Windows Server 2008, how do I go about capturing the output of a script that is being ran with the windows task scheduler?

I'm testing a rather long custom printing batch-script, and for debugging purposes, I would like to see all of the output from it every night.

Best Answer

Try this as the command string in Task Scheduler:

cmd /c yourscript.cmd > logall.txt