Program Preventing Windows From Sleeping
Don't Sleep is a small portable Windows program to prevent system shutdown, Standby, Hibernate, Turn Off and Restart. Especially when old Programs run on Windows-10 or Windows 8.1 / 7. Here's more aggressive power-saving features with new rules. How can the answer be improved?
- Program Preventing Windows From Sleeping Pills
- Program Preventing Windows From Sleeping
- Program Preventing Windows From Sleeping
First the question; How do I figure out what is preventing my Windows 7 computer from going into sleep mode?
Second; some background...
I've been struggling with this for a few days and am utterly perplexed. I setup sleep mode on my Windows 7 PC a few weeks ago, and all was well. The PC would sleep as expected and I was snuggly in knowing that my computer was saving power and some wear and tear on the components (we'll leave the 'is it better to sleep' debate for another thread/day, please don't start it).
Well, I noticed the other night that my system stopped ever going to sleep. I set the sleep time down to 1 minute and wandered fully away from the PC (ensuring that no errant mouse or keyboard movements would occur) and the PC never went to sleep. I've also observed this over longer intervals as well, such as overnight.
- I have sleep mode enabled, of course
- 'multimedia settings - When Sharing Media' is set to allow the computer to sleep.
- 'powercfg -lastwake' show nothing of interest, since it never goes to sleep and can't wake up.
- 'powercfg /requests' shows 3 entries - all '[DRIVER] ?'. I assume that 2 of these are my mouse and keyboard - as I've recently used them to run the powercfg command. I'm at a loss for the third though.
- I've unhooked all USB peripherals save for my keyboard and mouse.
- Wake on LAN is disabled in my BIOS.
- I know that you can disable all apps from waking/preventing sleep - but I want the ability to remain for those apps that do legitimately need to keep the system awake.
So; does anyone know of a way to figure out what the 3rd phantom '[DRIVER] ?' is in powercfg /requests?
BloodPhilia1 Answer
Bingo. I found it. An ISO mounting utility I ran had a file mounted and opened across the network. Apparently if a file is open for read across the network, Windows is prevented from sleeping.
On another note - I discovered a little quirk with the powercfg
utility. It seems to make a difference what type of terminal you run it from. Running under cygwin and Console2 gave false and erratic reports from the program (including a could not load energy.dll
error from running powercfg -ENERGY
). At first I thought the issues with [DRIVER] ?
were just a matter of the program not having sufficient information to determine the driver; but it was really a symptom of being executed under a standard cmd.exe
terminal.
As Emory points out in the comment below, the cause of this odd behavior is that powercfg
requires elevated permissions - requiring that it be run as Administrator. There is no warning built in to the program to alert the user, it will just return incorrect output (and possibly could not locate energy.dll
in the case of powercfg -ENERGY
). It must be run from a command prompt with elevated privileges.
Sooo... long story short... to determine what program is keeping your system from sleeping:
Program Preventing Windows From Sleeping Pills
- Run
cmd.exe
with administrative privileges (this is key,powercfg
will run under anything, but will give incorrect results) - Run
powercfg -requests
to get a listing of items currently preventing sleep.
I was able to determine that files open across the network were preventing sleep in my case.
NathanProgram Preventing Windows From Sleeping
protected by slhckJul 13 '14 at 15:52
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?