Solved

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

Posted on 2008-10-24
12
798 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
  • 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now