I’m trying to schedule a codeigniter php file in Windows Task Scheduler. I have tried using .bat file as follows:
php E:UniServerZindex.php mailtry mailsend
where mailtry
is controller name and mailsend
is controller function
I have also tried scheduling using powershell script using url as follows:
First:
powershell -ExecutionPolicy Bypass -Command Invoke-WebRequest 'https://abcd.hub/abcd/mailtry/mailsend' -UseBasicParsing
Second:
$url = "https://abcd.hub/abcd/mailtry/mailsend" PowerShell Invoke-WebRequest -Uri $url -Method GET
Third:
explorer "https://abcd.hub/abcd/mailtry/mailsend"
Nothing works. How to schedule this? Any help is much appreciated.
Advertisement
Answer
Hoping that if you go on a browser and execute that link it successfully works.
Then you can actually configure a task scheduler to open a certain browser then go for that link to execute.
At step 1 from the image put a path for a browser program like Firefox or google chrome within double quotes. e.g “C:Program Files (x86)Mozilla Firefoxfirefox.exe”
Then at step 2, simply add a link you wish to execute.
Then save your Task, you are done from there.
Reference: https://windowsloop.com/open-webpage-on-schedule-task-scheduler/
All the Best