Create a hourly schedule

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
Sharky
Posts: 1
Joined: Fri Dec 18, 2015 1:09 pm

Create a hourly schedule

Post 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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post 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.
Best regards,
Igor Siticov.
Post Reply