Set up your task to run when you want it (times and all that)
and pop this into the command
:
C:Pathophp.exe -f "C:Pathofile.php"
Edit: you can also set a second php.ini to be run used when the CLI is used to run a file, which has no constraints on max execution time and the like. Very handy difference and better suited to running (potentially) long execution scripts.
You can do this by creating a php-cgi.ini
file in your PHP folder where your php.ini
file resides. This will be used automatically when a PHP file is executed from the CLI (this is how scheduled tasks are run).
Also note that Windows Scheduler will simply end on an error that causes your script to fall over, so running some extra logging might be a good idea in case your scripts exit early.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…