{"id":465,"date":"2011-08-14T16:29:38","date_gmt":"2011-08-14T20:29:38","guid":{"rendered":"http:\/\/blog.bitsofgenius.com\/?p=465"},"modified":"2011-08-14T16:29:38","modified_gmt":"2011-08-14T20:29:38","slug":"the-mysterious-mutating-power-properties-solved","status":"publish","type":"post","link":"https:\/\/blog.bitsofgenius.com\/?p=465","title":{"rendered":"The mysterious mutating power properties .. SOLVED !"},"content":{"rendered":"<p>Back in 2009, I wrote a post related to issues of mutating power settings in Windows XP Media Center (<a href=\"http:\/\/blog.bitsofgenius.com\/?p=26\" target=\"_blank\">I\u2019ve got the Power! \u2026 but not over power properties?!<\/a>). Since then I have seen the problem also on Windows XP Professional, and on multiple manufacturers laptops (HP, Gateway and Dell). After digging a little further, it seems the problem is related to using a laptop as a host for \u00a0RDC connections for multiple user accounts, which exposes a design strategy in Windows XP that conflicts with this use.<\/p>\n<p>The power properties are strange. \u00a0Instead of being stored at the local machine level in the registry, they are stored at the user level. \u00a0There is a setting for the default user, and an override for each user account (which initially is only the same as the default). \u00a0That means that user A can choose to enable hibernation, while user B can choose not to. \u00a0That&#8217;s a strange design choice to me. \u00a0I can only assume that a user case was drawn up that most laptops are &#8220;personal&#8221;, only one user account exists for it, and it&#8217;s predominant use will be on demand use (i.e. not continuously available). \u00a0So the default was designed around this case.<\/p>\n<p>Since I use at least two laptops with multiple user accounts in a continously-on mode, and have them sitting under a desktop with the lid always closed, the default Microsoft chose is what is causing me continuing problems. \u00a0I can set the proper power properties while I am logged on but, without changing the global user defaults, the next user will inherit wrong settings.<\/p>\n<p>Knowing this now, the best way to establish the power scheme on a freshly-paved laptop to be used in this mode is&#8230;<\/p>\n<ul>\n<li>Setup the laptop with a new power scheme definition designed for its operation, and set that new power scheme as the active power scheme.<\/li>\n<li>Open RegEdit, and export this branch to a file:\u00a0HKEY_CURRENT_USER\\Control Panel\\PowerCfg<\/li>\n<li>In the file just created, change all references of\u00a0HKEY_CURRENT_USER\\ ..to..\u00a0HKEY_USERS\\.DEFAULT\\<\/li>\n<li>Import this file into the registry.<\/li>\n<\/ul>\n<p>This will set the default to the proper value, and every user who initially logs on from this point forward will inherit those default setting into their account.<\/p>\n<p>Still, this does not solve the problem of a user logging on, changing their settings, and causing the laptop to initiate sleep, standby or hibernation; thereby taking the laptop offline. \u00a0One way that can be addressed is with permissions on the registry branch. \u00a0Still, most people aren&#8217;t that interested in power settings, especially when they login to a computer they don&#8217;t see or manage.<\/p>\n<p>FWIW: If you&#8217;d like to reset the power settings to a fixed profile every time a user logs on, you can set this batch script to execute at logon. \u00a0It will create a schema for the power settings, program the settings, and make that schema the active one. \u00a0It will at least undo any tinkering done by a user the next time they log off.<\/p>\n<pre lang=\"text\">\r\n@echo off\r\nREM\r\nREM This script sets the power properties to prevent standby or\r\nREM hibernation while the computer is running on AC power.\r\nREM It creates a power scheme called AlwaysOn-RDC-Multiser, and\r\nREM sets the system to use this power scheme.\r\nREM\r\nREM This script is intended for laptops or even desktops, which\r\nREM are always running and are used as dev \"slop-boxes\" to test\r\nREM prototype code or are doing heavy-duty R&D work in a \"not \r\nREM ready for production\" capacity.  It prevents the computer from\r\nREM going into standby, sleep or hibernation, regardless of the\r\nREM user's preference.\r\nREM\r\nREM ** This script needs to be run as a startup script\r\nREM ** when a user logs in.  To do this:\r\nREM  1) Start \/ Run\r\nREM  2) gpedit.msc\r\nREM  3) Drill down to Local Computer Policy \/\r\nREM       Computer Configuration \/Windows Settings \/\r\nREM       Scripts (Startup \/ Shutdown)\r\nREM  4) In right panel, double-click Startup.\r\nREM  5) Click the Add button.\r\nREM  6) In the Script Name, enter the full path for this file.\r\nREM  7) Leave the Script Parameters blank and click OK.\r\nREM\r\n\r\npowercfg.exe \/C \"AlwaysOn-RDC-Multiser\"\r\n\r\npowercfg.exe \/H ON\r\n\r\nREM ** CORE SETTINGS **\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/monitor-timeout-ac 0\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/disk-timeout-ac 0\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/standby-timeout-ac 0\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/hibernate-timeout-ac 0\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/processor-throttle-ac NONE\r\nREM ** CORE SETTINGS **\r\n\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/monitor-timeout-dc 10\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/disk-timeout-dc 10\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/standby-timeout-dc 0\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/hibernate-timeout-dc 0\r\npowercfg.exe \/X \"AlwaysOn-RDC-Multiser\" \/processor-throttle-dc NONE\r\n\r\npowercfg.exe \/G ON \/OPTION BATTERYICON\r\npowercfg.exe \/G ON \/OPTION MULTIBATTERY\r\npowercfg.exe \/G OFF \/OPTION RESUMEPASSWORD\r\npowercfg.exe \/G ON \/OPTION WAKEONRING\r\npowercfg.exe \/G ON \/OPTION VIDEODIM\r\n\r\npowercfg.exe \/S \"AlwaysOn-RDC-Multiser\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Back in 2009, I wrote a post related to issues of mutating power settings in Windows XP Media Center (I\u2019ve got the Power! \u2026 but not over power properties?!). Since then I have seen the problem also on Windows XP Professional, and on multiple manufacturers laptops (HP, Gateway and Dell). After digging a little further, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,20,13,17],"tags":[],"class_list":["post-465","post","type-post","status-publish","format-standard","hentry","category-extensions-to-the-registry","category-technologynetworking","category-technologythoughts","category-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=\/wp\/v2\/posts\/465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=465"}],"version-history":[{"count":0,"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=\/wp\/v2\/posts\/465\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bitsofgenius.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}