【发布时间】:2011-04-26 21:52:57
【问题描述】:
我有一个任务(.bat 文件),应该在每 15 分钟后执行/执行一次。
我不知道在哪里输入以便安排?
有了这个,我想查看正在运行的任务的执行(进度)(在命令提示符下)。
【问题讨论】:
标签: windows batch-file scheduled-tasks
我有一个任务(.bat 文件),应该在每 15 分钟后执行/执行一次。
我不知道在哪里输入以便安排?
有了这个,我想查看正在运行的任务的执行(进度)(在命令提示符下)。
【问题讨论】:
标签: windows batch-file scheduled-tasks
引用自 Microsoft Technet 的一篇文章,Schtasks:
; To schedule a task that runs every 20 minutes
;
; The following command schedules a security script, Sec.vbs,
; to run every 20 minutes. The ; command uses the /sc parameter
; to specify a minute schedule and the /mo parameter to specify
; an interval of 20 minutes.
; Because the command does not include a starting date or time,
; the task starts 20 minutes after the command completes, and
; runs every 20 minutes thereafter whenever the system is running.
; Notice that the security script source file is located on a
; remote computer, but that the task is scheduled and executes
; on the local computer.
schtasks /create /sc minute /mo 20 /tn "Security Script" /tr \\central\data\scripts\sec.vbs
您可以在上面提到的参考中找到更多的解释和示例。
【讨论】:
看看schtasks命令在命令行设置任务
C:\test>schtasks /?
【讨论】:
schtasks 在大多数情况下优于 at,但请注意它在 Windows XP Home 或 XP 之前的任何版本中不可用。
Task Scheduler 是手动执行此操作的简单方法。
如果您需要编写脚本,请查看 at 命令。
【讨论】: