How can I make my laptop go to sleep 5 minutes *after* closing the lid?

5

1

Windows 7 can turn go to sleep when I close my lid, or after a period of inactivity. Fine.

I don't want it to go to sleep immediately after closing the lid; I want it to wait 5 minutes and then go to sleep.

Can this be done?

Jay Bazuzi

Posted 2011-08-08T04:16:04.260

Reputation: 3 780

this http://stackoverflow.com/questions/3355606/detect-laptop-lid-closure-and-opening was about the needed API for creating such program. Still trying to decipher what it means. I suppose I can make a tiny C# apps to deal with it

– Martheen Cahya Paulo – 2011-08-08T04:45:00.733

Why do you want to do this? – soandos – 2011-08-08T04:49:52.520

2@soandos I close up my laptop around 5pm all the time, only to have the phone ring as I'm still packing it up with some final thing someone wants to check. – Joel Coehoorn – 2011-08-08T05:25:10.170

Answers

3

This capability isn't built into windows 7, and I'm not aware of software that will do this (thought that certainly doesn't mean no such software exists). If you have any programming ability (and your profile indicates you're no slouch here), this stackoverflow question will get you started building your own:

https://stackoverflow.com/questions/3355606/detect-laptop-lid-closure-and-opening

In a nutshell: set the default action in Windows 7 to not do anything, but have your program running as a service and handle the WM_POWERBROADCAST message. When you spot one with the right data, set a timer for 5 minutes and put the machine to sleep when it goes off. Different data on that message or messages that indicate user activity (like WM_MOUSEMOVE or WM_KEYDOWN) might cancel the timer.

Joel Coehoorn

Posted 2011-08-08T04:16:04.260

Reputation: 26 787

0

I'm looking for the same thing (Windows 8.1 now). Lenovo used to have a utility in its power management program that did this, but it's no longer there (mostly as Windows machines start back up a lot faster than they used to).

I'm currently thinking there might be a way to create a scheduled task which is triggered by an event, which then starts a timer, and so on.

askvictor

Posted 2011-08-08T04:16:04.260

Reputation: 1 450