【发布时间】:2018-07-18 18:36:10
【问题描述】:
我已将 Perl 脚本配置为通过 Windows 任务计划程序定期运行。
Action: Start a program
Program: C:\Perl64\bin\perl.exe
Add arguments: script.pl config.json > output.txt 2>&1
or: script.pl config.json 2>&1 > output.txt
Start in: c:\path\to\scriptPL\
程序运行,但它在$ARGV[1] 中获得> 或2>&1,而不是重定向输出。从命令提示符运行时,输出重定向工作。
我错过了什么?
【问题讨论】:
-
我知道,在您的情况下,您指定了“开始于”目录 - 但它的默认值是空的 - 所以很容易丢失它 - 并且有一个像我这样的案例,其中文件我正在重定向到实际上最终位于 C:\Windows\System32 - 只是给可能正在搜索类似案例的其他人的注释......
标签: perl scheduled-tasks taskscheduler output-redirect