How do I capture the output of a script if it is being ran by the task scheduler? December 15, 2022 by Tarik Try this as the command string in Task Scheduler: cmd /c yourscript.cmd > logall.txt