在Java中的Windows Task Scheduler中注册任务 [英] Register task in windows task scheduler in java

查看:68
本文介绍了在Java中的Windows Task Scheduler中注册任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Java在Windows Task Scheduler中注册任务?

How can I register a task in windows task scheduler using java?

我想要的是我的日历Java程序将在该小时内发生事件时通知我.即使我的计算机处于睡眠模式,我也希望得到通知.

What I want is that my calendar java program will notify me if there is an event in that hour. I want to be notified even if my computer is in sleep mode.

是否可以使用Java在Windows任务计划程序中注册任务?
如果可能,怎么办?

Is it possible to register a task in the Windows task scheduler using java?
If it is possible, How?

我在Stack Overflow中阅读了与此相关的一些问题,有人回答了.他/她的回答是,将任务注册到Windows任务计划程序,它将告诉主板在需要运行任务时唤醒.

I read some questions related to this in Stack Overflow and someone answered. His/her answer is that, register the task to windows task scheduler and it will tell motherboard to wake up when it needed to run the task.

推荐答案

Windows具有命令 at schtasks ,这些命令使您可以从该命令创建和管理计划的任务线.请参阅此链接以获取更多文档.

Windows has the commands at and schtasks which allow you to create and manage scheduled tasks from the command line. See this link for further documentation.

如果您知道如何根据需要运行此命令,则可以使用

If you know how to run this commands for your needs you can invoke them from Java using java.lang.ProcessBuilder.

这篇关于在Java中的Windows Task Scheduler中注册任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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