Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    96
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Command line PHP to open a file

    Hi,

    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:

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

    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.

  • #2
    New Coder
    Join Date
    Mar 2009
    Posts
    96
    Thanks
    11
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •