I set up a Windows Task Scheduler task to automatically run a .cmd script every day at a set time. This task has worked for a while, but recently every time it runs the scheduled task will timeout. I get the error "Task stopping due to timeout reached". However, I’ve set a pretty long timeout in the task, so it shouldn't be taking timing out (the task has an 8 hour timeout, and the script should finish running in about 40 minutes). Additionally, if I run the script manually, everything works perfectly.
I've run into this issue before, where I have a scheduled task to run this script, and the task suddenly starts timing out every time it runs. Same thing where running the script manually works with no issues.
I've tried restarting the server, and I've tried deleting the scheduled task and creating a new scheduled task with identical settings. This sometimes works, but eventually the task starts timing out again.
Here are the settings in Task Scheduler:
- Run whether the user is logged on or not
- Triggers
- Begin the task: On a schedule
- Daily
- 8:30:00 PM
- Recur every 1 days
- Enabled
- Actions
- Start a program
- Prgram/script: C:\Users\myUser\Desktop\script.cmd
- Settings
- Allow task to be run on demand (selected)
- Stop task if it runs longs than 8 hours
- If the running task does not end when requested, force it to stop (selected)
- If the task is already running, then the following rule applies: Stop the existing instance