{"id":554,"date":"2010-11-19T22:29:58","date_gmt":"2010-11-20T05:29:58","guid":{"rendered":"http:\/\/mpsharp.com\/blog\/?p=554"},"modified":"2010-11-19T22:29:58","modified_gmt":"2010-11-20T05:29:58","slug":"windows-7-sleep-debugging","status":"publish","type":"post","link":"https:\/\/mpsharp.com\/?p=554","title":{"rendered":"Windows 7 Sleep Debugging"},"content":{"rendered":"<p>So after I added the SSD to the HTPC and\u00a0moved my hard disk into the\u00a0 NAS  drive, I began to notice the machine no  longer automatically goes to sleep.\u00a0\u00a0\u00a0 If I hit the power button (set to sleep)  or run it from the command line (<span style=\"font-family: Courier New;\">%windir%\\System32\\rundll32.exe powrprof.dll,SetSuspendState  Standby<\/span>) the machine goes to sleep just fine, but won&#8217;t do so  automatically.<\/p>\n<p>Mucking with powercfg (which is a very interesting program BTW.\u00a0 Run powercfg  \/? if you&#8217;re not familiar with it) I found the following:<\/p>\n<p>powercfg -requests<\/p>\n<p>[DRIVER] \\FileSystem\\rdbss<br \/>\nA file has been opened across the network. File  name: [\\medianas\\Photos\\blah\\blah\\blah\\IMG_9088.jpg] Process ID:  [4456]<br \/>\n[DRIVER] \\FileSystem\\rdbss<br \/>\nA file has been opened across the  network. File name: [\\medianas\\Photos\\blah\\blah\\SANY0014.jpg] Process ID:  [4456]<br \/>\n[DRIVER] \\FileSystem\\rdbss<br \/>\nA file has been opened across the  network. File name: [\\medianas\\Photos\\blah\\blah\\blah\\IMG_9160.jpg] Process  ID: [4456]<br \/>\n[DRIVER] \\FileSystem\\rdbss<br \/>\nA file has been opened across the  network. File name: [\\medianas\\Photos\\blah\\blah\\SANY0118.jpg] Process ID:  [4456]<br \/>\n[DRIVER] \\FileSystem\\rdbss<br \/>\nA file has been opened across the  network. File name: [\\medianas\\Photos\\blah\\blah\\IMG_0053.jpg] Process ID:  [4456]<br \/>\n[DRIVER] \\FileSystem\\rdbss<br \/>\nA file has been opened across the  network. File name: [\\medianas\\Photos\\blah\\blah\\PC060102.jpg] Process ID:  [4456]<br \/>\n&#8230;.<\/p>\n<p>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.\u00a0\u00a0\u00a0 I really  like the screen saver, and I don&#8217;t want to suck up space on the SSD with photos.\u00a0\u00a0 What to do?<\/p>\n<p>It turns out, there&#8217;s a hidden setting in powercfg which will allow to enable sleep when files are open over the network.\u00a0\u00a0 I assume the option is hidden by default because most folks wouldn&#8217;t understand what &#8220;remote opens&#8221; were.\u00a0\u00a0\u00a0\u00a0 There&#8217;s a very<a href=\"http:\/\/iboyd.net\/index.php\/2010\/05\/16\/windows-7-power-management-fixing-pc-insomnia\/\" target=\"_blank\" rel=\"noopener\"> helpful blog post<\/a> here which explains a number of hidden power\/sleep settings in gory detail.\u00a0\u00a0 Low and behold after importing the registry file (run regedit as administrator):<\/p>\n<figure id=\"attachment_555\" aria-describedby=\"caption-attachment-555\" style=\"width: 273px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.mpsharp.com\/blog\/wp-content\/uploads\/2010\/11\/RemoteOpens.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-555 \" title=\"RemoteOpens\" src=\"https:\/\/www.mpsharp.com\/blog\/wp-content\/uploads\/2010\/11\/RemoteOpens-273x300.png\" alt=\"\" width=\"273\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-555\" class=\"wp-caption-text\">Hidden option in Windows Power Config<\/figcaption><\/figure>\n<p>Still need to do a little more testing but I figure this should do the trick.\u00a0\u00a0 Just a couple more handy commands for my own reference:<\/p>\n<p>Put the computer to sleep from the command line<\/p>\n<blockquote><p><code>%windir%\\System32\\rundll32.exe powrprof.dll,SetSuspendState Standby<\/code><\/p><\/blockquote>\n<p>What was the last reason the PC woke up from sleep<\/p>\n<blockquote><p><code>powercfg -lastwake<\/code><\/p><\/blockquote>\n<p>List all the requests from processes to prevent the computer from sleeping:<\/p>\n<blockquote><p><code>powercfg -requests<\/code><\/p><\/blockquote>\n<p>Analyze any power usage issues the system might have<\/p>\n<blockquote><p><code>powercfg -energy<\/code><\/p><\/blockquote>\n<p>See &#8220;powercfg \/?&#8221; for more info.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So after I added the SSD to the HTPC and\u00a0moved my hard disk into the\u00a0 NAS drive, I began to notice the machine no longer automatically goes to sleep.\u00a0\u00a0\u00a0 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,&hellip; <a class=\"more-link\" href=\"https:\/\/mpsharp.com\/?p=554\">Continue reading <span class=\"screen-reader-text\">Windows 7 Sleep Debugging<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9],"tags":[],"class_list":["post-554","post","type-post","status-publish","format-standard","hentry","category-home-theater","category-windows","entry"],"_links":{"self":[{"href":"https:\/\/mpsharp.com\/index.php?rest_route=\/wp\/v2\/posts\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mpsharp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mpsharp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mpsharp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mpsharp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=554"}],"version-history":[{"count":0,"href":"https:\/\/mpsharp.com\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions"}],"wp:attachment":[{"href":"https:\/\/mpsharp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mpsharp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mpsharp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}