我有一些可执行文件计划使用 Windows 任务计划程序运行。他们有必须在某处看到的输出。通过 Windows 任务计划程序运行应用程序时,程序的输出会丢失。我怎样才能捕获这个输出?我搜索了谷歌并找到了替代运行 cmd 并将输出重定向到日志文件的黑客,但我无法将这些信息很好地放在 XML 文件中,我应该能够在任务调度程序中注册,所以我需要一个更好的方法。
如有任何帮助,我们将不胜感激。
最佳答案
如上所述:
OK, so the hack is not described as working for the Windows TS XML Schema. The redirection part, >> log 2>&1, is not really part of "arguments"; it's interpreted by the cmd shell rather than processed by the program. I imagine that's why it doesn't work as part of . One reasonable workaround would be to have Windows TS execute a batch file, and have the batch file execute c:...\sunspotters.bat -i ... >> test.output.txt 2>&1
关于xml - Windows 任务计划程序输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12292090/