Windows Task Scheduler - On Idle Trigger Not Always Working
Scenario
I'm using Windows Task Scheduler to accomplish the following:
- run program when system is idle
- stop program when system is no longer idle (user moves mouse etc)
- re-run the program when system enters idle again
- rinse and repeat indefinitely
Problem
This works after computer restart and thereafter for some time but at some point it stops working and I am having a difficult time figuring out why.
Question
How can I figured out why this task eventually fails and/or how do I fix it ?
Current task settings
General
- Use user account: My Computer/Jackson
- Run whether user is logged on or not: Checked
Triggers
- On idle: When computer is idle: Enabled
Actions
- Start a program: C:/Users/Jackson/xyz.exe
Conditions
- Start the task only if computer is idle for: 1 minute
- Wait for idle for: 1 minute
- Stop if the computer ceased to be idle: Checked
- Restart if the idle state resumes: Checked
- Wake the computer to run this task: Checked
- Start only if the following network connection is available: Any connection
Settings
- Allow task to be run on demand: Checked
- Run task as soon as possible after a scheduled start is missed: Checked
- If the task fails, restart every: 1 minute
- Attempt to restart up to: 3 times
- If the running task does not end when requested, force it to stop: Checked
- If the task is already running, then the following rule applies: Do not start a new instance
Solution 1:
While writing this question I had a thought to change Settings:Attempt Restart from 3
to 999
. This seems to be working so far.
The theory is that after 3 iterations of idling then returning to normal use this schedule won't restart anymore until windows is restarted also resetting the "restart counter" back to 0.
Strong Note
"idle" seems to correspond with screen saver. So when you screen saver is active then your computer is rendered as "idle". This seems as intuitive as not-intuitive. Anyway, make sure you have a screen saver setup if you want to use an idle schedule.
** EDIT **
Now days I am not checking "wait for idle" at all. The idea being that I don't want to wait for idle to check for idle, since the trigger is "idle" the trigger should trip once the system is considered idle. I also use "on workstation lock" and have the screensaver set to "show password on resume" so I'm not sure which route is actually being used. Cheers!