0

Does anyone know of a free (preferably open-source) program that can wake up the computer from sleep/hibernate and do something, like play an alarm sound?

(Yes, this is possible -- Windows's SetWaitableTimer function allows you to set a "resume on sleep" parameter. And yes, I need to actually be able to wake up the computer, so programs that can't do this don't help.)

fixer1234
  • 27,064
  • 61
  • 75
  • 116
user541686
  • 23,663
  • 46
  • 140
  • 214

1 Answers1

3

Windows task scheduler can do this. Run it, click create task, then go to the conditions tab. There's a checkbox for waking the computer to perform the task. You can then have it run a program. It doesn't actually need to be a program, you can just browse to your favorite mp3 file or whatever, and it will run whatever program is associated to play sound files.

CreeDorofl
  • 2,301
  • 7
  • 26
  • 37
  • +1 this answer needs lots of upvotes! :D Thanks a lot! Just a question, though: Is there any way to put the computer back to sleep after the task, if it was already asleep? – user541686 Mar 26 '11 at 19:32
  • I don't think it does... One solution, a little ugly, is to schedule a 2nd task at the same time as your alarm. That task runs this: http://www.mydigitallife.info/2007/11/29/schedule-windows-shutdown-with-vista-shutdown-sleep-timer/ – CreeDorofl Mar 26 '11 at 19:38
  • @CreeDorofl: I thought about that, but the problem is that it will run whether or not the computer was already asleep. :\ – user541686 Mar 26 '11 at 19:44
  • hrm, not sure why that wouldn't work... task 1 is your alarm sound. Task 2 runs right after that and forces sleep mode with that 2nd program. It can force it after 5 minutes or however much time you want. – CreeDorofl Mar 26 '11 at 19:48
  • @CreeDorofl: But what if the computer wasn't already sleeping? It should only sleep if the computer was asleep; otherwise, the computer might be busy with something, so we don't want to make it sleep. – user541686 Mar 26 '11 at 20:03
  • You'll have to check the events in the event log, looking for the last time the computer did wake up. If the computer was not sleeping when the task has been launched, don't shutdown it. – dolmen Mar 26 '11 at 20:42
  • Oh I follow what you mean. Is your computer set to sleep after XX minutes? Does it sleep sometimes even when you want it to do some task (process video, 3D render, something else?) My impression is, the computer won't sleep if it's busy with something important. Maybe it depends on each program whether sleep can interrupt the program or not. – CreeDorofl Mar 27 '11 at 02:13