Welcome! Log In Create A New Profile

Advanced

Running from a scheduled task

Posted by Jeff Graham 
Jeff Graham
Running from a scheduled task
February 12, 2009 09:28PM
Hi All,

Is there a way to know that the WinDev application is running from a scheduled task?

Is there a clever way to put a message on the screen saying that it executed successfully and at what time. Then exit without the message going away?

We have several daily procedures that can be scheduled to run at night.

Thanks in advance,
Jeff
Fabrice Harari
Re: Running from a scheduled task
February 12, 2009 11:27PM
Hi Jeff...

1. You should be able to setup the scheduled task to send a parameter ("fromScheduler") to the program when it's started... In the program, commandline will tell you what's what

2. Message: to keep the message visible, you need to have a program running (I think, except if there is something in windows for that, via api). if you have several programs running independently, I would just create a separate messaging program in charge of displaying them in separate windows... each "true" program would write the message to display (title, content, date/time, etc) in an ini file in the messaging program data folder... The message program would look in this folder every 'n' minutes and display new messages...

Best regards

Jeff Graham
Re: Running from a scheduled task
February 13, 2009 07:59PM
Hi Fabrice,

Thanks for the suggestions. We are passing parameters from the scheduler to indicate what task to perform and that works great. I will set a global variable so that any routine can know if Info, Error, etc. messages can be used. The task routines are also executed from the application in normal mode as well.

I just have to clean up all the processing to make sure none of the code can try to put a message window up when running from the scheduler and to trap automatic error messages.

I now just write a log file. I am thinking of modifying your clLog class to handle messages by putting them in the log file if running from a scheduler.

Cheers,
Jeff
Jeff Graham
Re: Running from a scheduled task
February 16, 2009 06:21PM
Hi All,

PC Soft responded to my question on detecting execution from a scheduled task:

.Not possible at the moment. I made a suggestion to get a function such as "inShareProcMode". Please use the following reference if you contact me on the same subject #60928/249185.

Cheers,
Jeff
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: