1

Having a very strange case here, where a windows task scheduler job executes a C# console application at a specific time, that returns -1 in case of an error. The job is configured to rerun itself if an error occurs.

The console app fails and returns the error code. The task scheduler recognizes the return code as 4294967295 (0xffffffff), which is -1 interpreted as a DWORD (unsigned int), claims a successful run and thus does not rerun the failed app.

Is this some kind of bug, where task scheduler is not realizing, that the app is returning a negative number, or am I missing something here?

lauxjpn
  • 231
  • 3
  • 8
  • My research suggests that the Task Scheduler does not check the return code at all, and the "failed" option only kicks in if the task fails to start. (Or perhaps if the time limit expires and the task is killed?) I couldn't find any MS documentation though. – Harry Johnston May 18 '19 at 00:46

0 Answers0