Trigger Task Scheduler in Windows 7 when computer wakes up from sleep/hibernate

07
2013-09
  • Adam

    I don't want task scheduler or whatever to wake the computer, but when I open the laptop back up and the machine wakes I'd like that to be the trigger that task scheduler or something uses to run an app.

  • Answers
  • Joey

    You can tick the “Run task as soon as possible after a scheduled start is missed” checkbox on the Settings tab for the task. That's for tasks at least that are scheduled regularly and fail to start due to sleep/hibernate/shutdown.

    There doesn't seem to be a trigger "On waking from sleep", but you can probably use the “On Event” trigger. The interesting events seem to be from “Kernel-Power” and “Power-Troubleshooter”. System sleep generates an event from Kernel-Power with event ID 42. Wakeup is an event from Power-Troubleshooter with event ID 1.

  • Rangi Robinson

    The event-based solution suggested by Johannes worked well for me. I wanted a certain text file (my to do list) to open in Notepad every time I un-hibernated my computer (Windows 7). I set up a scheduled task to run with this event as a trigger:

    • Log: System
    • Source:Power-Troubleshooter
    • Event ID: 1

    This is working well for me.


  • Related Question

    sleep - task scheduler won't wake the computer
  • valya

    I want my computer to start uTorrent at 4 o'clock in the morning, when I'm asleep. But the computer is a bit noisy so I put it to sleep mode every time I go to bed.

    I've tried creating a task in Task Scheduler with this parameters:

    Run whether user is logged in or not Daily At 4:00 every day Start a program "C:\Program Files\uTorrent\uTorrent.exe" Wake the computer to run this task

    I've tried to change the time to run to make sure the computer wakes up and runs uTorrent. But it doesn't.

    What am I doing wrong? Maybe I've lost something?


  • Related Answers
  • enter image description here 8088

    I had the same problem. In the end it was a stupid default configuration in the Windows 7 power plan options. Go to "Control Panel -> All Control Panel Items -> Power Options -> Edit Plan Settings" for the power plan u are using. Then select "Change advanced power settings". Next go to "Sleep -> Allow wake timers" and enable them there. At least in my case they were by default disabled. IMHO kinda stupid especially if one can schedule tasks that are supposed to wake up without getting a warning.

  • 8088

    How about you set the auto power on timer in BIOS?

    It should be under the power management section of the BIOS, named something like "Wake by RTC etc". You may see the below example BIOS screenshot:

    alt text

  • John T

    Make sure you follow everything in this article accurately. I've also had an issue with accounts that have no password before. If your account does not have a password, try giving it one and see if the results differ, I'm pretty sure you need a password to run a scheduled task. If it already has one, make sure it was typed correctly. You should be able to see why the last task didn't run successfully in task scheduler.

  • CarlF

    Have you tried starting the task without sleeping the computer first, to make sure that wake-from-sleep is the problem? You might have the wrong path or something, and you just think the problem is waking.

  • Jonny Best

    You might have to enable hybrid sleep in order for it to work. The quickest way to do this is to run powercfg.exe -H ON(see technet) from an elevated command prompt.