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?
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:
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.
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.