How do I set up a PHP file to run in Windows Task Scheduler?

I have a PHP script that I want to run every four hours. I have set it up to run in Windows Task Scheduler by calling my Firefox browser and running the script. The ‘Action’ line in Task Scheduler is:

"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" mullbed2\\control\\localUpdate.php 

That works, but inevitably also opens a blank tab in the browser, which I’d like to avoid (although for testing purposes it was quite handy because I could show error messages).

I’m sure there should be a way of running the script without calling Firefox (as if from a command line), but I’ve tried:

"C:\\SERVER\\PHP\\php.exe" d:\\websites\\mullbed2\\control\\localUpdate.php

and some variants, without any success. The paths to ‘php.exe’ and the script are correct.

Can anyone tell me what I’m doing wrong and point me in the right direction, please ?

What happens if you try running this from a command prompt, does it run?

Thank you, Fretburner, a good question.

Actually it does try (so the command line itself is likely OK), but there’s a PHP warning followed by a fatal error message because a PHP ‘required’ file can’t be found. I shall try putting the absolute path to this file instead of the relative path that works OK within the browser.

If that works there are likely to be a number of other relative paths that will need adjusting before it all runs as required.

LATER: Yes, that fixed it. Thank you. When it runs in Task Scheduler the Windows Command Prompt window flashes up briefly, but it hadn’t been showing the error messages that I saw when I ran directly from the Command Prompt. A useful lesson learned.