This forum is designated to discuss SiComponents Scheduling Agent.
famini
Posts: 4 Joined: Mon Oct 22, 2007 12:21 pm
Post
by famini » Fri May 16, 2008 9:37 am
Hello,
I'd like to schedule a task in Vista but I have some problems.
This task must be executed every hour between 0 AM and 12PM.
For XP I use :
Code: Select all
Task.Triggers[0].StartDate := Date();
Task.Triggers[0].StartTime := 0;
Task.Triggers[0].Duration := 1440; // 24 hours
Task.Triggers[0].Interval := 60; // every hour
But this doesn't work in Vista
How can I do this without change property TaskScheduler1Only to True ?
Thanks,
isiticov
Site Admin
Posts: 2416 Joined: Thu Nov 21, 2002 3:17 pm
Post
by isiticov » Fri May 16, 2008 11:41 am
Hello,
There is a problem with this under Vista. We will fix this in forthcoming 2.0.1 release.
Best regards,
Igor Siticov.
famini
Posts: 4 Joined: Mon Oct 22, 2007 12:21 pm
Post
by famini » Fri May 16, 2008 12:14 pm
Thank you for your answer isiticov.
By searching in the component source I have found a solution to my problem by setting the properties "Interval" & "Duration" of the IRepetitionPattern interface.
Here is the code :
Code: Select all
if TaskScheduler.RunningVistaOrLater then begin
Task.Triggers[0].GetVistaTrigger().Repetition.Interval := 'PT1H'; // 1 hour
Task.Triggers[0].GetVistaTrigger().Repetition.Duration := 'PT24H'; // 24 hours
end;
Regards
isiticov
Site Admin
Posts: 2416 Joined: Thu Nov 21, 2002 3:17 pm
Post
by isiticov » Fri May 16, 2008 3:04 pm
Yes, exactly. These fields shall to be used.
Best regards,
Igor Siticov.