Solved

Remotely changing the function of the power buttons action from "Do Nothing" to "Shutdown" on multiple machines

Posted on 2008-10-24
12
810 Views
Last Modified: 2010-04-21
I am trying to find a way of changing the function of the power button from "Do nothing" to "Shutdown" on over 7000 screens running windows XP.

I have spent hours and hours on this - trawling the internet for information but have had little success.
Powercfg doesn't appear to have a switch to set this.

I have used a registry compare tool to and the following registry keys were changed:

[HKEY_CURRENT_USER\Control Panel\PowerCfg\GlobalPowerPolicy]
"Policies"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count]
"HRZR_EHAPCY"
"HRZR_EHAPCY:\"P:\\JVAQBJF\\flfgrz32\\cbjrepst.pcy\",Cbjre Bcgvbaf"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU\0]
"MRUListEx"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\Bags\1\Shell]
"ScrollPos800x480(1).y"=dword:00000000
"ShowCmd"=dword:00000001
"WFlags"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG]
"Seed"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Prefetcher]
"TracesProcessed"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power]
"AcPolicy"
"DcPolicy"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
"AcPolicy"
"DcPolicy"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache]
"@C:\\WINDOWS\\system32\\shell32.dll,-22924"

I exported all of these keys with the values correctly set and compiled the relevant keys into one file called SD Keys. I then set the test machine back to the "Do Nothing" setting and double clicked the SD Keys reg file and got the confirmation that the settings had been changed. However the setting within power options stayed at "Do Nothing" and pressing the power button had no effect.

Any help on this would be GREATLY appreciated.
0
Comment
Question by:deathbybatfile
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 51

Expert Comment

by:Netman66
ID: 22809220
It fairly simple when you use POWERCFG.exe.

You want to set your power options as you desire, then EXPORT them to a named file.
You can now save this file to a network share and execute POWERCFG /import to import that scheme into the local PC.

Running it remotely can be accomplished either using RDP or PSEXEC as long as the scheme is copied locally so you have access to it.



0
 

Author Comment

by:deathbybatfile
ID: 22811230
That does not accomplish the act of changing what the power button does when pressed. When you import the new scheme (and make it active) it doesn't include the power button setting.
0
 
LVL 51

Expert Comment

by:Netman66
ID: 22811239
Really?

Interesting.  It's supposed to be all part of that Power profile.

Let me see what I can find for you.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:deathbybatfile
ID: 22811273
Yeah I did try it but it doesn't affect the power button - I've looked everywhere so any help you can offer will be well received!! Thanks.
0
 
LVL 51

Accepted Solution

by:
Netman66 earned 500 total points
ID: 22812132
Ok, I've managed to determine what gets changed using a program called RegShot.

Download it from here: http://downloads.sourceforge.net/regshot/regshot_1.8.2_src_bin.zip?modtime=1194107176&big_mirror=0

Open up the Power Options applet and configure everything the way you want it then Apply it.  Be sure to leave the Power Button setting to do nothing.  Leave the applet open and on the screen where the button change is made.

Run RegShot Shot1 with the defaults.
Leave it open when done.
Change the button setting and press Apply.
In RegShot run Shot2.
In RegShot run Compare.
Save the output log.

The only settings you likely need are in HKLM.  
Create a Reg file from this log and test it out.

It may need to be run as Admin, but let's get the basic steps working.
0
 

Author Comment

by:deathbybatfile
ID: 22813708
Thanks Netman - I'll try that. I did try the same thing with Reg snap but will try Reg shot and see if I have more luck.
0
 
LVL 51

Expert Comment

by:Netman66
ID: 22814323
ok.

Those entries are a bit cryptic.  I'm really not sure about the Cryptographic keys and whether your domain workstations have all the same values.  You *might* get by without using those entries, you'll have to test what the bare minimum is in terms of what keys to modify to get this to work.

0
 

Author Comment

by:deathbybatfile
ID: 22833187
This tool gave me pretty much the same settings but when I exported each of the settings (in the desired state - to shutdown) - changed the machine to "Do nothing" then imported the relevant reg files it has no effect. Not sure why this won't work. Any ideas?
0
 
LVL 51

Expert Comment

by:Netman66
ID: 22834032
No, I can't imagine why - sorry.

0
 

Author Comment

by:deathbybatfile
ID: 22893620
This is a bit embarassing really and just indicative of my newcomer status to programming!

I've just been working on another bat file to change the settings of another program which involved changing the registry settings - again these were not reflected in the GUI on examination but after restart they were. I realised that this may well have been the issue with this earlier attempt to change the power button setting and sure enough on testing it - that's all it was. I guess each program needs re-initialising with it's new settings.

Thought I should update and close this question as I found very little data on this online though it is perhaps more obvious to a more experienced programmer.

For clarity - the keys I had to change (for Win XP) were:

HKEY_CURRENT_USER\Control Panel\PowerCfg\GlobalPowerPolicy]
"Policies"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power]
"AcPolicy"
"DcPolicy"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
"AcPolicy"
"DcPolicy"

This set it exactly as I wanted it after restart. My only issue then was to make it run once only which was simply acheived by creating a dat file and skipping the import if this file existed.

Thanks for all the help :D
0
 

Author Closing Comment

by:deathbybatfile
ID: 31509574
Thanks - can't blame you for presuming I would have had the sense to restart the damn cpu after import! >.<
0
 
LVL 51

Expert Comment

by:Netman66
ID: 22894871
LOL....too funny.

You wouldn't expect a Reg setting to require a reboot, but I guess this is one that does...good to know!

Thanks,
NM
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XP machine unable to logon 13 61
Move XP PC to Vmware 22 156
Task with PowerShell Script is failing with 0x41301 7 122
repairing Windows XP on a different partition 17 103
Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question