2

I have some scheduled tasks on Windows server 2016 that are scheduled to run weekly (Monday to Friday) at a specific time.

When i disable these tasks and re-enable them, they are failing to run unless I run them manually via task scheduler.

The last run time and last run result values do not change when the re-enabled task fails to run, however, they do change when i run the task manually.

Can someone please advise as to why the scheduled tasks are not running as expected after being re-enabled ?

Please feel free to ask any questions.

1 Answers1

0

The scheduled task that was not running after being re-enabled was running via a command line window. I found that if i closed the running task simply by closing the command line window, the "last run result" value for the task in task scheduler will display the error code:0xC000013A. With this error code, disabling and re-enabling the task will not allow the task to be re-enabled, it will only be re-enabled once the task has been run manually at least once after being re-enabled. However, if we close the running task by firstly ending the session via task scheduler and then closing the window, the last run result value for the task would then be: 0x41306. In this case, if we disable/re-enable the task while the last run result value is: 0x41306, it will run as expected.