New
#1
Task Scheduler: running skipped task when it shouldn't?
I have a secondary computer in the network, which is supposed to stay in sleep mode most of the time. I always wake it up when necessary and put it back to sleep when it is no longer needed. I don't want it to fall asleep by itself during the day, so I set the sleep time to "Never" in Power Settings. However, I want it to automatically fall asleep at 9PM (if at the time it is not sleeping already).
So, in order to satisfy these requirements I created a .bat file containing the following line
and I added that .bat file to Task Scheduler, asking it to run it every evening at 9PM. I made sure that "Wake the computer to run this task" flag is cleared. I also made sure that "Run task as soon as possible after a scheduled start is missed" flag is also cleared.Code:%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby
However, the next morning when I come to that computer and wake it up for the first time, it wakes up and then immediately falls asleep again. Then I wake it up again and it stays on. Looking into the Task Scheduler reveals that Task Scheduler actually decides to run this task immediately after I wake up the computer, thus putting it back to sleep.
Why does this happen? I believe my set of settings is telling Task Scheduler not to try to run this task if the original scheduled time (9PM) is missed. Why then does it attempt to run it when I wake the computer the next morning? What else do I need to specify to make Task Scheduler to quietly ignore missed attempts to run this task?