windows 下用命令来操作定时任务

cmd下定时执行命令可以使用 at 命令 或者 schtasks命令。
at 语法:at +时间+运行程序
schtasks语法:schtasks /creat /tn 设定定时运行的名字 /tr “运行程序” /sc daily /st时间
例:
1、at 12:30 notepad(12:30时运行记事本)

2、at 19:30 calc(19:30时运行计算器)
3、schtasks /create /tn 定时运行 /tr "notepad" /sc daily /st 12:30(12:30时运行记事本)
4、schtasks /create /tn 定时运行 /tr "calc" /sc daily /st 19:30(19:30时运行计算器)

schtasks /create /tn solrindex /tr C:\windows\system32\notepad.exe /sc minute /mo 1 这是一分钟执行一次

注意其实windows提供界面管理的,找到以后可以修改他的是否登录执行还是后端执行,

猜你喜欢

转载自www.cnblogs.com/weiyiyong/p/10092143.html