Windows 7 Sleep Debugging

So after I added the SSD to the HTPC and moved my hard disk into the  NAS drive, I began to notice the machine no longer automatically goes to sleep.    If I hit the power button (set to sleep) or run it from the command line (%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby) the machine goes to sleep just fine, but won’t do so automatically.

Mucking with powercfg (which is a very interesting program BTW.  Run powercfg /? if you’re not familiar with it) I found the following:

powercfg -requests

[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\medianas\Photos\blah\blah\blah\IMG_9088.jpg] Process ID: [4456]
[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\medianas\Photos\blah\blah\SANY0014.jpg] Process ID: [4456]
[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\medianas\Photos\blah\blah\blah\IMG_9160.jpg] Process ID: [4456]
[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\medianas\Photos\blah\blah\SANY0118.jpg] Process ID: [4456]
[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\medianas\Photos\blah\blah\IMG_0053.jpg] Process ID: [4456]
[DRIVER] \FileSystem\rdbss
A file has been opened across the network. File name: [\medianas\Photos\blah\blah\PC060102.jpg] Process ID: [4456]
….

So basically, the Media Center Screen saver is actually preventing the system from going to sleep because it has all these photo files open across the network.    I really like the screen saver, and I don’t want to suck up space on the SSD with photos.   What to do?

It turns out, there’s a hidden setting in powercfg which will allow to enable sleep when files are open over the network.   I assume the option is hidden by default because most folks wouldn’t understand what “remote opens” were.     There’s a very helpful blog post here which explains a number of hidden power/sleep settings in gory detail.   Low and behold after importing the registry file (run regedit as administrator):

Hidden option in Windows Power Config

Still need to do a little more testing but I figure this should do the trick.   Just a couple more handy commands for my own reference:

Put the computer to sleep from the command line

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby

What was the last reason the PC woke up from sleep

powercfg -lastwake

List all the requests from processes to prevent the computer from sleeping:

powercfg -requests

Analyze any power usage issues the system might have

powercfg -energy

See “powercfg /?” for more info.

Leave a comment

Your email address will not be published. Required fields are marked *