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

7,206

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.

Share:
7,206

Related videos on Youtube

Niels R.
Author by

Niels R.

I'm a freelance .NET/C# developer.

Updated on September 17, 2022

Comments

  • Niels R.
    Niels R. over 1 year

    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.

    • natxo asenjo
      natxo asenjo over 13 years
      what is in the log file?
  • Paul D'Ambra
    Paul D'Ambra over 13 years
    You can specify what folder a scheduled task starts in on Windows so could have fixed this without access to the code too...