当前位置:网站首页>利用win10计划任务程序定时自动运行jar包
利用win10计划任务程序定时自动运行jar包
2022-07-04 15:26:00 【@大熊_】
利用win10计划任务程序定时自动运行jar包
1. 开始前的准备
- .config配置文件目录(我的java程序中会读取一个.config文件夹里的配置文件,你们的根据自己编写的java程序而定,可忽略)
- 自己的jar包
- 新建一个空run.bat脚本
如图:
2. 编写run.bat脚本内容
记事本打开,输入执行jar的命令,并保存。
如:
java -jar D:\OneDrive\Desktop\update-tools\boot-01-helloworld-1.0.jar
3. 打开任务计划程序
在windows搜索框中搜索"任务计划程序",并打开。
新建一个文件夹,如图:
创建任务->常规 ,如图:
选到触发器->新建,如图:
选到操作->新建,如图:
图里的第5步很重要,如果你也像我一样,编写的java程序中会读取一个.config文件夹里的配置文件,这里**起始于:**的路径就需要填上jar和.config文件夹所在的路径,如果你编写java程序中不需要读取配置文件,这里可以不填也能运行jar包,但会不会影响程序的最终效果就不清楚了,建议都填上。最后点确认,就可以等待程序的运行了。
运行结果:
(图里的时间对不上,是因为是我之前截的图)
结束
如有错误之处,请斧正。
边栏推荐
猜你喜欢
Congratulations to Mr. Zhang Pengfei, chief data scientist of artefact, for winning the campaign Asia tech MVP 2022
GO开发:如何利用Go单例模式保障流媒体高并发的安全性?
祝贺Artefact首席数据科学家张鹏飞先生荣获 Campaign Asia Tech MVP 2022
对人胜率84%,DeepMind AI首次在西洋陆军棋中达到人类专家水平
S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
Smart Logistics Park supply chain management system solution: digital intelligent supply chain enables a new supply chain model for the logistics transportation industry
overflow:auto与felx结合的用法
从数数开始
Principle and general steps of SQL injection
随机推荐
同构图与异构图CYPHER-TASK设计与TASK锁机制
金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
Solution of commercial supply chain coordination system in the mineral industry: build a digital intelligent supply chain platform to ensure the safe supply of mineral resources
GO开发:如何利用Go单例模式保障流媒体高并发的安全性?
MVC模式和三层架构
矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
The test experience "tortured" by the PMP test is worth your review
Sql实现Split
~88 running people practice
How to contribute to the source code of ongdb core project
leetcode刷题目录总结
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
DC-2靶场搭建及渗透实战详细过程(DC靶场系列)
Go language loop statement (under Lesson 10)
Oracle监听器Server端与Client端配置实例
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"
中位数与次序统计量
Position encoding practice in transformer
Pytorch deep learning quick start tutorial
Linear time sequencing