I thought I had set up a successful schedule in Windows to run a PHP script. But all I got was an error which slaps only when run through the task scheduler.
Here is how I run the task:
I created a batch file runCron.bat:
start php.exe reportGenerator.php
and placed reportGenerator.php in the same folder as of the batch file.
When I manually execute the batch file, all is well. But when the same batch file is called by the task scheduler, PHP CLI throws the following error:
Could not open input file:
reportGenerator.php
What would have been missed? I understand it’s a path issue, but where exactly is the issue?
Thank you for any help.
try
it probably looks for the script in the schedulers working directory, not in the bat file dir