How do I capture the output of a script if it is being ran by the task scheduler?

前端 未结 9 843
旧巷少年郎
旧巷少年郎 2020-12-02 08:37

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 pr

9条回答
  •  我在风中等你
    2020-12-02 09:14

    The >> will append the log file, rather than overwriting it each time. The 2>&1 will also send errors to your log file.

    cmd /c YourProgram.exe >> log.txt 2>&1
    

提交回复
热议问题