The schtasks command is quite particular in how it deals with users and background/foreground. I much prefer creating and managing scheduled tasks from the command line (much less hassle than the GUI and I can adjust things exactly to my liking very quickly this way), but foreground/background is a specific issue. To show how it works with examples:
The following task will run every 30 minutes (but only in the background! The use of /ru and /rp forces this to happen):
schtasks /create /sc minute /mo 30 /tn "Notes" /tr notepad.exe /ru /rp
However, if you run the following command, it will run in the foreground with your credentials (so if you want to monitor the job, you will be able to do that as follows):
schtasks /create /sc minute /mo 30 /tn "Notes" /tr notepad.exe
This is quite odd the first time I saw it, but once you know the rule, it's simple. As you say, oddly in the GUI, you have to set the username/password as the current user for it to work in the foreground, which seems opposite.
Some more examples:
schtasks /create /sc minute /mo 30 /tn "Notes" /tr "php C:\path\to\script.php argument"
schtasks /create /sc minute /mo 30 /tn "Notes" /tr "start /min C:\Users\John\MyPHPscript.bat"
then put into the MyPHPscript.bat: php C:\path\to\script.php argument
To properly view the specific task (showing also the command line used):
schtasks /query /tn "Notes" /v /fo list