Scheduled Task: Last run result = 0xFFFFFFFB / Works when running from command prompt

scheduled-taskwindows-server-2008

I have a small job (.NET Console Application) scheduled to run daily. The scheduled task runs under a specific user.

When I log in with this user I can run the application without a problem from the command prompt, but when the task is triggered (manually or automatically) it always returns 0xFFFFFFFB as result.

Any suggestions what this error code could mean? (I've searched the web, but very little useful info turns up… It's mostly Linux/Samba related stuff.)

Some extra info: the applications simply reads some data from a SQL Server, dumps it to a local CSV file, pushes this file to a FTP server and deletes the local CSV file.

Cheers,
Niels R.

Best Answer

Ok, I've found the problem.

Seems that the person who wrote the console application didn't specify a path for the temporary CSV file. When you're running from the command prompt this is not a problem as the file will be written in the folder where the executable resides. When running as a scheduled task this isn't true as the application then tries to write the file to the C:\WINDOWS\System32 folder. This results in an "Access to the path 'C:\Windows\system32\SOME_FILE_NAME.csv' is denied." error.

The above plus the lack of a log file is what made this a frustrating ride. Luckily I had access to the source code!

Sorry to bother with this question, but I hope it might help other people in the future.