1

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.

  • superuser.com/questions/1282944/… – Moab Jan 23 '19 at 17:36
  • Hi, Thanks for the links but I have already had a look at them and they are not the same exact problem i'm experiencing. In those cases, it looks like tasks are being set to run every five minutes, whereas, my tasks are set to run once per day. – TheManBehindTheMan Jan 24 '19 at 9:49
  • @TheManBehindTheMan Please read over superuser.com/questions/1334495/… to see what I'm referring to about getting the XML from a Task Scheduler job. You create the file and then you can open it in a text editor and mask about usernames, etc. you don't want to share. This will show the way you have all the Task Scheduler job properties configured. You can use pastebin.com to create a free link to share the detail and then tag me back via @PimpJuiceIT – Pimp Juice IT Jan 26 '19 at 19:42
  • 1
    @PimpJuiceIT Sorry i have taken so long to get back to you. I have now found a way to work around it which i will post shortly after this response. – TheManBehindTheMan Feb 19 '19 at 14:33
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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.