Laravel application is hosted in windows server, hence created a task using Task Scheduler which runs every 1 minute.
Task is used to run a program which is saved in a file named cron.bat
, of which the contents are
cd C:\inetpub\wwwroot
C:\php\php.exe artisan schedule:run >> .\storage\logs\cron.log 2>&1
However when the task is run, an entry is logged into the cron.log
file but none of the commands associated with the task is executed. I do not see any error logs in laravel.log
file
But when I change the cron.bat
file contents to
cd C:\inetpub\wwwroot
C:\php\php.exe artisan command:name
It executes the respective command.
Why would this happen? I have given Full Control to all the files and folders in wwwroot
and cron.bat
file which resides in wwwroot
.