ozhovnir,
You may want to try this, as it works for us on Server 2012.
General Tab:
Run using the Administrator Account
Check “Run whether the user is logged in or not” and "Run with the highest privileges"
Configure for “Windows Vista, Windows Server 2008”
On the Trigger Tab:
Make a new trigger
Begin Task on a Schedule
Daily, pick a time, not really important when
Check to repeat, set it for every 5 mins for a duration of 1 day
Nothing else should be checked, except for “Enabled”
Action Tab:
Program/script
"C:\Program Files (x86)\PHP\php-win.exe"
Or path to the php-win.exe file Do not put anything else in there. Make sure you have the double quotes at the beginning and end of the path.
Add Arguments (optional)
-f "C:\path\to\xibo\maintenance.php" passwordhere
Make sure you have the double quotes at the beginning and end of the path.
Start in (optional)
Leave this blank
Conditions Tab:
Only Check “Start the task only if the computer is on AC power"
and
"Wake the computer to run this task” (Your server shouldn’t be sleeping anyway)
Settings Tab:
Check “Allow task to be run on demand”, “Run task as soon as possible after a scheduled start is missed”, “Stop the task if it runs longer than: 3 days”, “If the running task does not end when requested, force it to stop”
Make sure “Do not start a new instance” is selected
I think that will do it.
Oh last thing, Windows will always report the (0XFF) on completion, however the script does run, and the maintenance emails are generated.
The (0xFF) is logged because the file being ran cannot return the proper exit code to windows. I am not sure how you could make it do so. I think that the PHP script would need to somehow alert PHP and/or Apache, and then the success command would need to be sent back to Windows.
The only other option is to use a batch file with the last line being “exit”. But still this will not return the correct response as it is only saying that the batch file exited correctly. Although this might be helpful.
I would love to know if you come up with a working, correct solution for the result code.