bat文件scriptinf用于不同的计划时间 [英] bat file scriptinf for different schedule times

查看:113
本文介绍了bat文件scriptinf用于不同的计划时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在任务计划中创建了2个简单的基本任务,一个用于开始,另一个用于在每天的特定时间停止WinService。现在,我想让脚本更加全面,例如像这样:

I created 2 simple basic tasks in Task Schedule, one for Start and another for Stop a WinService at certain times on Daily basis. Now, I want to have the script somehow more comprehensive, e.g. like that:

Start: Monday-Friday, 5 AM
       Sat+Sunday, 7 AM
Stop:  Monday-Thursday & Sunday: 12 AM
       Friday, Sat.: 3 AM



如何在一个或两个.bat文件中编写这些脚本?谢谢。


How to script these in one or two .bat file(s)? Thanks.

推荐答案

了解 Windows任务计划程序的命令行界面: http://en.wikipedia.org/wiki/Windows_Task_Scheduler [ ^ ]。



对于v.1.0,可以使用at.exe(不建议使用),对于v.2.0,schtasks 。可执行程序。语法可以在这里找到: http:// msdn .microsoft.com / zh-CN / library / windows / desktop / bb736357%28v = vs.85%29.aspx [ ^ ]。



另请参阅: http://technet.microsoft.com/en-us/magazine/ff356867。 aspx [ ^ ]。



-SA
Learn command-line interface of the Windows Task Scheduler: http://en.wikipedia.org/wiki/Windows_Task_Scheduler[^].

For v.1.0, at.exe can be used (deprecated), for v.2.0, schtasks.exe. The syntax can be found here: http://msdn.microsoft.com/en-us/library/windows/desktop/bb736357%28v=vs.85%29.aspx[^].

See also: http://technet.microsoft.com/en-us/magazine/ff356867.aspx[^].

—SA


这篇关于bat文件scriptinf用于不同的计划时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆