Please forgive my English (I am using an online translator) and my doubt, I am not a professional developer, like all of you.
I wrote a simple application, using Delphi 7 Personal and Scheduling Agent v1.0.5 (registered), and it works well.
But if the Task Scheduler service in Windows XP SP2 is disabled and stopped, the application does not start (the Demo of Scheduling Agent does not start either), and return the error "Task Scheduler service is not running".
I have made a modification in saTask.pas, procedure TTaskScheduler.SetActive:
begin
// if (Value) then -> old line
if (Value) and (StartScheduler) then // -> modification
Open
else
Close;
end;
With that modification, the application starts when the Task Scheduler service is disabled, so a custom error message can be shown if the user try to use the "Edit Task" function and the other functions of the application can be used.
My doubt is: this goes to cause some malfunction in Scheduling Agent?
Thank you in advanced!
Task Scheduler service disabled
Hello,
Actually, StartScheduler will start the Scheduler service and this is why your application started to work. I would recommend you the following:
1. Set Active property of TaskScheduler component to False at design-time.
2. In OnCreate event of your form activate it using
or
Please note: this might cause some problems on some users who "doesn't like@ your app start Scheduler Service. So it may be worth to ask them after checking the return of SchedulerServiceRunning method.
Hope this helps.
Actually, StartScheduler will start the Scheduler service and this is why your application started to work. I would recommend you the following:
1. Set Active property of TaskScheduler component to False at design-time.
2. In OnCreate event of your form activate it using
Code: Select all
try
TaskScheduler1.Active := True;
except
... Add here some actions in case Scheduler was unable to start.
end;
Code: Select all
if TaskScheduler1.SchedulerServiceRunning then
TaskScheduler1.Active := True
else
begin
if TaskScheduler1.StartScheduler then
TaskScheduler1.Active := True
else
ShowMessage('Unable to start Scheduler service!');
end;
Hope this helps.
Best regards,
Igor Siticov.
Igor Siticov.
Thank you very much for your fast response!
I have tested your recomendation, but it does not work, the application does not initialize, it shows an error message, and another, and another, and finally ends the messages, but does not start at all.
The demo of Scheduling Agent shows two error messages and does not start either.
Sorry, but is the StartScheduler capable of initialize the Task Scheduler service if it is not only stopped, but also disabled?
I am asking that because if it is, I will have to discovery why in my tests it is not.
Thank you again.
I have tested your recomendation, but it does not work, the application does not initialize, it shows an error message, and another, and another, and finally ends the messages, but does not start at all.
The demo of Scheduling Agent shows two error messages and does not start either.
Sorry, but is the StartScheduler capable of initialize the Task Scheduler service if it is not only stopped, but also disabled?
I am asking that because if it is, I will have to discovery why in my tests it is not.
Thank you again.
It's ok, it's not a problem, the Scheduling Agent is a fantastic component!
Actually, I would only like to know if this small modification in saTask.pas,
which I described in my first post, will cause unexpected problems in
Scheduling Agent. What do you think about this?
Please excuse me to disturb you again with the same question!
Thank you.
Actually, I would only like to know if this small modification in saTask.pas,
which I described in my first post, will cause unexpected problems in
Scheduling Agent. What do you think about this?
Please excuse me to disturb you again with the same question!
Thank you.