It doesn't make sense. You can verify the path on the server by executing
where schtasks to verify the path. The only difference otherwise is you specify one as an .exe and the other you do not, but neither should make a difference.
Are you sure that the second error reporting isn't the first? Did you delete the output file after the first run then try again to verify the same error? You'll want to make sure you're not running cached as well, so just give it a random querystring on the request.
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php