xml - Windows 任务计划程序输出

标签 xml windows logging scheduled-tasks

我有一些可执行文件计划使用 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/

相关文章:

java - 通过 ProcessBuilder 运行时 Shell 脚本挂起

c - 卡在 GStreamer 日志记录上

c# - XML 反序列化 IEnumerable 类时出错

java - 如何解析(然后查找特定的)从 API 请求接收到的 XML 数据?

windows - Git diff 在窗口 git bash shell (Windows) 中损坏

c++ - 如何完全清除Windows C++中的所有用户环境变量

windows - 使用特定 JRE 运行 JAR 文件

java - 减少 log4j.xml 中 Tomcat Digester 记录器的冗长程度

java - "Invalid byte 1 of 1-byte UTF-8 sequence"读取 RSS 源时

java - 从具有相似属性名称的 XSD 生成 JAXB 类