Hi,
I have a Xailer TaskScheduler program that is very successful and I am trying converting it to run as a service.
All is going well and it appears to run as a service 95% OK, except for my Timer function when it wants to actually execute the task .... calling my RunNow() method.
My problem is how to run the required .exe from within my program running as a service.
The 'non service' code that works fine is this
METHOD RunNow() Class ScheduledTask
Execute( ::cFile, FilePath( ::cFile ) )
RETURN( self )
This would work fine with ::cFile = "c:\windows\system32\notepad.exe" ..... notepad pops up on the PC main window in the usual way.
Problem is it appears to not do anything visible when executed from a service.
So question is :
1. Can I execute a program from a Xailer service program to appear on the PC main window ... I really hope so!
2. What is the function to do this, possibly ShellExecute or ????
Any help would be appreciated.
Thanks
Chris
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
My TaskScheduler as a service ....
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
- ignacio
- Site Admin
- Mensajes: 9259
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: My TaskScheduler as a service ....
Hi,
1) I believe is not possible, sorry.
Regards,
1) I believe is not possible, sorry.
Regards,
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Re: My TaskScheduler as a service ....
Oh dear, thats not what I wanted to hear.
Is this something to do with how Xailer has implemented the service code ?
There are some other 3rd party Task Schedulers that do run as services and can launch exes plus of course Windows own Task Scheduler.
I can see that Microsoft would want it to be difficult to do because of worries of malware, virus etc.
Oh dear, I was very pleased with my code, but its not much use now.
If you get a 'eureka' moment and can see how to do it, please let me know.
Chris
Is this something to do with how Xailer has implemented the service code ?
There are some other 3rd party Task Schedulers that do run as services and can launch exes plus of course Windows own Task Scheduler.
I can see that Microsoft would want it to be difficult to do because of worries of malware, virus etc.
Oh dear, I was very pleased with my code, but its not much use now.
If you get a 'eureka' moment and can see how to do it, please let me know.
Chris
- ignacio
- Site Admin
- Mensajes: 9259
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: My TaskScheduler as a service ....
ChrisGillard escribió:Oh dear, thats not what I wanted to hear.
Is this something to do with how Xailer has implemented the service code ?
There are some other 3rd party Task Schedulers that do run as services and can launch exes plus of course Windows own Task Scheduler.
I can see that Microsoft would want it to be difficult to do because of worries of malware, virus etc.
Oh dear, I was very pleased with my code, but its not much use now.
If you get a 'eureka' moment and can see how to do it, please let me know.
Chris
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Re: My TaskScheduler as a service ....
Hi Ignacio,
Thanks for continuing with this.
I was fairly aware about that no interaction was possible.
The applications I want to run are things like night time 'batch jobs', written in Harbour that do not interact with the screen but just do various 'housekeeping' jobs and when finished they just exit.
Maybe my example of notepad.exe was a bad one.
I have not actually tried to run one of our Harbour 'batch jobs'.
I will have a go and see.
Regards
Chris
Thanks for continuing with this.
I was fairly aware about that no interaction was possible.
The applications I want to run are things like night time 'batch jobs', written in Harbour that do not interact with the screen but just do various 'housekeeping' jobs and when finished they just exit.
Maybe my example of notepad.exe was a bad one.
I have not actually tried to run one of our Harbour 'batch jobs'.
I will have a go and see.
Regards
Chris