我在编写脚本以自动在
Windows中创建计划任务时遇到问题.
经过大量谷歌搜索,我无法推断命令行实用程序SCHTASKS.EXE中的哪些参数控制设置“如果它运行了几个小时就停止任务”.
你最好的可能是/ DU开关.
/DU duration
A value that specifies the duration to
run the task. The time format is HH:mm
(24-hour time). For example,14:50
specifies 2:50PM. This is not
applicable with /ET and for the
following schedule types: ONSTART,
ONLOGON,ONIDLE,and ONEVENT. For /V1
tasks (Task Scheduler 1.0 tasks),if
/RI is specified,then the duration
default is one hour.Windows XP: This option is not
available.
Quoted from MSDN.为什么TechNet Library page for schtasks中没有这些信息超出了我的范围.