Hi ,
I need a php script to run periodically or at application startup .
Ivied manage to create a .bat file which sets a task in windows, but the problem is i can’t run the php file from the bat ,or i don’t know how to accomplish this.
Any pointers on how can i make my cron.php file run in the background ?
Hi,
This is not the official answer, but I’m going to need something similar soon, and here’s what I was thinking of:
Create a standard PHP page in the ExeOutput file, as per normal.
Set up ExeOutput to allow multiple instances to run
In your batch file, use the ExeOutput command line parameters (see “Application Command Line Arguments” in the helpfile) to launch your executable at the page you created in step 1 (eg MyExe.exe page ‘path\to\your\page.php’ )
Works like a charm, the aplication dosent actualy start ( nothing visibale ) when the task starts.
This is the whay i use the file path in the bat, since my files are external .
The cron like works grate , but I’m facing a small problem , it’s not really something that needs fixing but if there’s a solution would be perfect.
Lunching myapp.exe to load my cron.php from the task scheduler is a good solution , but every time it gets lurched from task starts a new instance in case of “allow multiple instances”, in the case that multiple instances are not allowed when it lunches the exe gets me to my home page if the application is opened.
So ivied created a new project cron.exe in the same folder that uses a single external page from my main aplication ( Data/include/cron.php ) with a minimum window 0 height 0 width so that when it opens doesn’t distract much .
At the end of my cron.php page i use this exo_runhescriptcom ( “Macros.MacroExit” ); to close the app when the php code finishes its work.
And now the cron.exe starts and closes every 10 min with a minimum distraction , the only thing that bothers me is the icon popping up and despairing in the programs bar every 10 min.
Is there a whey that i can eliminate the icon and the windows like a silent mode ? maybe something made in HEScript which i don’t understand much.
I know that all this can be avoided with php.exe but in case of ExeOutput this is not possible ( I think ) .
[quote]Exe To Service allows you to install any Windows executable, VBS or JS script as a service. Windows services are background processes that do not interfere with the logged in user’s environment. Windows services are controlled by the Service Control Manager. You can start them on boot before the user logs on and control their execution remotely. Exe To Service also installs a simple service scheduler. Thus, you can also start services at a specified time.[/quote] - http://www.exetoservice.com/
You could try to use a Tray icon instead: http://www.exeoutput.com/help/trayicon.htm
In a future version, we’ll add the option to create non-GUI PHP applications, like for other PHP to EXE compilers.