Page 1 of 1

Create a hourly schedule

Posted: Wed Mar 02, 2016 6:43 pm
by Sharky
How can I create an hourly schedule with VCL Scheduling agent?

If Task Scheduler it can be creates this way:

Triggers -> Edit -> Repeat task every 1 hour for duration Indefinitely

Posted: Thu Mar 03, 2016 3:31 pm
by isiticov
If you open the Demo project, you may find there a quick demo menu item that runs custom exe every 10 minutes for 24 hours. This is the sample you need. Please check Createtasktorunevery10minutesfor24hours1Click() event code.
The only changes you would need to create hourly task are:
1. Instead of Triggers[0].Interval := 10; use Triggers[0].Interval := 60; (Means run every 60 minutes)
2. Instead of Triggers[0].Duration := 24 * 60; (means run for 24 hours) you can use Triggers[0].Duration := 24 * 60 * X; (where X is the needed amount of days)

If you need to run it indefinitely then:
When running under Windows Vista or later just don’t set anything to Duration property and this will setup it to run indefinitely. We will update the code to use 0 as value for indefinitely settings. When running under Windows earlier than Vista (if needed) just set HasEndDate property of Trigger to False.