Windows 7 task scheduler keeps returning operational code 2

I set up a scheduled task to run under my account. Everything it runs, even if it is successful, returns an operational code of (2). I looked this up this error code at the below link, and it claims it cannot find the specific file.

Even if I do something very simple, I get back operational code of (2). For example:

run program: cmd.exe

start in path: c:\windows\system32

I start the task and I see the process running in my task manager, so I kill the task. I then check in the history of scheduled task and it shows up as (2).

Something more realistic of what I am doing:

/* file in c:\php\test.php */
echo "hello";

run program: php.exe

start in path: c:\php

arguments: -f test.php

Everything works in the command line, but Windows schedule task keeps returning operational code (2). I should be seeing an operational code of (0), which means successful, correct?


You may not have put a path in the "Start In (Optional) box of the Edit Action dialog box.

Even though you had a path on the program that was being executed, Windows 7 still wants you to tell it where to run the program.