Register task in windows task scheduler in java

大兔子大兔子 提交于 2020-01-17 05:03:56

问题


How can I register a task in windows task scheduler using 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.

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/35523943/register-task-in-windows-task-scheduler-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!