Php – How to run a PHP file in a scheduled task (Windows Task Scheduler)

PHPscheduled-taskswindows

How can I create a scheduled task to run a PHP file?
Yes, I filled out everything in the scheduled task, but it still doesn't work.

Run: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website\save.php"

Start in: "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website"

It just opens the PHP file in Notepad.

I gave the correct user name and pwd.

Please help me..

Best Answer

The Run command should be

C:\Path\to\php.exe -f "C:\Path\to\file.php"

From the command line help of php.exe:

-f         Parse and execute <file>.