View Full Version : Command line PHP to open a file

06-30-2010, 11:19 AM

I am trying to run a scheduled task on Windows 2007 that simply reads another file, but it's not working.

I have set up the scheduled task to run the file script.bat, which contains the following:

C:\Program%20Files\PHP\php.exe -f C:\inetpub\Staging\Gemma\Site1\schedule.php

As I am trying to get the script schedule.php to run at midnight every night.

When I do a test run on the script it says it has completed - but it has not run the schedule.php page. Have I done something stupid in the command line code?

I am a complete novice with command line so apologies if this is a daft question - I can't seem to find any tutorials to help.

06-30-2010, 12:04 PM
Just incase anyone wants to know the answer - I was correct in my assumption that I was being rather stupid!

Forgot the php bit before the schedule.php file's line.

So, you need to have:

php -f C:\inetpub\Staging\Gemma\Site1\schedule.php