Written on : 13/07/2011 15:38 ( more than one month ) Object : Re: Scheduled Reports Not Sending. Ok. Found some more information. By doing the batch file, the script can't access something it needs. That is why the script gets the error. The way I have it setup now is working just fine.
Set up a Scheduled task to run daily and whatever time you want the reports to send. Personally mine are setup at 12:01AM each day. Have the task launch internet explorer. After you have created the task go into the properties. The task will show that it is running:
C:\PROGRA~1\INTERN~1\iexplore.exe
After this string put in a space and point to the php report cron file as such in quotes. The string will look like this when you are done. Of course your file path may be different, but as long as it still points to the file:
C:\PROGRA~1\INTERN~1\iexplore.exe "http://localhost/cron/cron.report.php"
Now there is one last thing that needs to be setup. The script only take a few seconds to run, BUT there is no close window command or anything in the script, so as far as windows is concerned, even when it is done it is still running, so you have to tell windows to manually kill the task after a given period, i used 10 minutes to make sure it has much more time than it will ever need. Do this by going to the settings tab in the task. Check "Stop the task if it runs for: and change it from the default 72 hours to, in my case, 10 minutes. I also would check to make sure that "Wake the computer to run this task" is checked especially if this task is going to be running in the early morning hours.
So far this has worked perfect for me. |