What's the $retval giving you back? I'd assume that schtasks would return 0 on success.
The entire purpose has me a bit confused though. You schedule to run once notepad and launch a file, which you then write to with the information about the task. That seems a bit pointless IMO.
The $out should contain the output of the call, which is nothing (erm, I think its nothing). When you've redirected the output to the file, the stdout won't have anything in it to present back to PHP. So that cannot be used to determine if it was successful.
0-byte file would say either it doesn't find the task, or that there is no permissions to write. In either case I would actually expect that the $out would contain that, but its possible that you may need to redirect the stderr to the stdout as well.
Windows web servers are such a nightmare to work with :/
header('HTTP/1.1 420 Enhance Your Calm');