Register task in windows task scheduler in java

2019-09-09 21:50发布

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条回答
Juvenile、少年°
2楼-- · 2019-09-09 22:16

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.

查看更多
登录 后发表回答