如何在一段时间内重复运行批处理文件:计划任务

发布于 2024-09-28 06:48:07 字数 107 浏览 5 评论 0原文

我有一个任务(.bat 文件),应该每 15 分钟后执行/执行一次。

我不知道在哪里输入以便安排它?

有了这个,我想查看正在运行的任务的执行(进度)(在命令提示符中)。

I've a task(.bat file) which should be performed/executed after every 15mins.

I don't know where to make its entry so that it'll be scheduled?

With this, I want to see the execution(progress) of the task running(in command prompt).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

隔纱相望 2024-10-05 06:48:07

查看 schtasks 命令在命令行上设置任务

C:\test>schtasks /?

take a look at schtasks command to set task on the command line

C:\test>schtasks /?
夏花。依旧 2024-10-05 06:48:07

任务计划程序是手动执行此操作的简单方法。

如果您需要编写脚本,请查看 at命令。

The Task Scheduler is an easy way to do this manually.

If you need to script it, look at the at command.

呆萌少年 2024-10-05 06:48:07

引自 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

您可以在上述参考文献中找到更多解释和示例。

Quoted from a Microsoft Technet article, 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

You can find more explanations and examples in the reference mentioned above.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文