BleepingComputer.com: Custom Power Button Action

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Custom Power Button Action

#1 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 01 December 2008 - 03:42 PM

Hi, I really miss the functionality of XP allowing you to set the power button action to ask what you want to do.
Posted Image
Unfortunately, Vista seems to have gotten rid of that option, while leaving the ability of the popup ask what wou want to do
(shown in this short JScript)
(new ActiveXObject("Shell.Application")).ShutdownWindows();

Posted Image
Is there a way to "remap" the power button? I've tried to use autohotkey, but it doesn't seem to support the power button...
Thanks,
-Matt

This post has been edited by mattk37: 01 December 2008 - 03:52 PM


#2 User is offline   garmanma 

  • Computer Masochist
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Staff Emeritus
  • Posts: 27,809
  • Joined: 27-January 07
  • Location:Cleveland, Ohio

Posted 01 December 2008 - 03:56 PM

I don't like it either. I haven't come across a hack yet. I let you know if I do
Mark
Posted Image
why won't my laptop work?

Having grandkids is God's way of giving you a 2nd chance because you were too busy working your butt off the 1st time around
Do not send me PMs with problems that should be posted in the forums. Keep it in the forums, so everyone benefits
Become a BleepingComputer fan: Facebook and Twitter

#3 User is offline   usasma 

  • Still visually handicapped, new avatar (a camel) :0)
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 16,689
  • Joined: 02-October 05
  • Gender:Male
  • Location:Southeastern CT, USA

Posted 01 December 2008 - 05:46 PM

It's incorporated in the Start button. Click on the > arrowhead to the right of the Lock Computer thingie:
Posted Image
- John
**If you need a more detailed explanation, please ask for it. I have the Knack. **

#4 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 01 December 2008 - 05:53 PM

View Postusasma, on Dec 1 2008, 04:46 PM, said:

It's incorporated in the Start button. Click on the > arrowhead to the right of the Lock Computer thingie:
Posted Image


nonono I know that already... :huh:
what i am saying is pressing the actual power button on the tower to show the options

This post has been edited by mattk37: 01 December 2008 - 07:04 PM


#5 User is offline   garmanma 

  • Computer Masochist
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Staff Emeritus
  • Posts: 27,809
  • Joined: 27-January 07
  • Location:Cleveland, Ohio

Posted 01 December 2008 - 07:18 PM

Go to the Control Panel>Power Options and on the left should be "Click on what the power button does" and choose the option you want

This post has been edited by garmanma: 01 December 2008 - 07:19 PM

Mark
Posted Image
why won't my laptop work?

Having grandkids is God's way of giving you a 2nd chance because you were too busy working your butt off the 1st time around
Do not send me PMs with problems that should be posted in the forums. Keep it in the forums, so everyone benefits
Become a BleepingComputer fan: Facebook and Twitter

#6 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 01 December 2008 - 08:39 PM

View Postgarmanma, on Dec 1 2008, 06:18 PM, said:

Go to the Control Panel>Power Options and on the left should be "Click on what the power button does" and choose the option you want

ugh again:
ASK what to do
NOT a single action (see pics in original post)

#7 User is offline   usasma 

  • Still visually handicapped, new avatar (a camel) :0)
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 16,689
  • Joined: 02-October 05
  • Gender:Male
  • Location:Southeastern CT, USA

Posted 02 December 2008 - 08:24 AM

Quote

nonono I know that already... dry.gif
what i am saying is pressing the actual power button on the tower to show the options


When I press the power button at work (on an XP system) it does not show those screens. But this is a setting in the Advance tab of the Power Settings in XP (and the "Do nothing" option is missing in Vista).

The Vista registry is similar to XP - so if you can find the registry keys that affect this, then you may be able to reproduce the behavior in Vista. To find it, you'll have to get a backup copy of your XP registry before AND after you make the changes. Then use a registry compare tool to find out what entries are changed - and use that to change the Vista entries.

Don't forget to backup your registry before making any changes.

Good luck!
- John
**If you need a more detailed explanation, please ask for it. I have the Knack. **

#8 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 02 December 2008 - 04:17 PM

Here is what i'm saying:
in xp, it gave the option of "Ask Me What to Do" when i pressed the power button:

Posted Image

in Vista, that option is no longer there (Do Nothing IS there usasma):

Posted Image

I compared the registry and i've narrowed it down to a few, but i have no experience with hex (which is what the options are stored as)

This post has been edited by mattk37: 02 December 2008 - 04:18 PM


#9 User is offline   usasma 

  • Still visually handicapped, new avatar (a camel) :0)
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 16,689
  • Joined: 02-October 05
  • Gender:Male
  • Location:Southeastern CT, USA

Posted 02 December 2008 - 04:30 PM

Post the registry entries here for us to have a look at and we'll try to see if we can help figure it out.
I've got a Vista and an XP VM that I can easily hose if need be. :huh:
- John
**If you need a more detailed explanation, please ask for it. I have the Knack. **

#10 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 02 December 2008 - 08:04 PM

ok, attached are the regshot results, ignore the REALLY long entries changed in the Vista one.
the file names explain what i did.
thanks :huh:

Attached File(s)



#11 User is offline   usasma 

  • Still visually handicapped, new avatar (a camel) :0)
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 16,689
  • Joined: 02-October 05
  • Gender:Male
  • Location:Southeastern CT, USA

Posted 03 December 2008 - 04:25 PM

Haven't been able to locate the registry item, but found a powercfg command that should do it for Vista (while at work). I have to find it again and I'll post it then.
- John
**If you need a more detailed explanation, please ask for it. I have the Knack. **

#12 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 03 December 2008 - 07:34 PM

View Postusasma, on Dec 3 2008, 03:25 PM, said:

Haven't been able to locate the registry item, but found a powercfg command that should do it for Vista (while at work). I have to find it again and I'll post it then.

that would be awesome :huh:

#13 User is offline   usasma 

  • Still visually handicapped, new avatar (a camel) :0)
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 16,689
  • Joined: 02-October 05
  • Gender:Male
  • Location:Southeastern CT, USA

Posted 03 December 2008 - 08:46 PM

Looks like the "close action" and the "also needed to show up on Power Menus" options are what you're looking for:
http://blogs.technet.com/richardsmith/arch...-the-guids.aspx

Let us know if it works for you - I haven't been able to try it on my system yet.
- John
**If you need a more detailed explanation, please ask for it. I have the Knack. **

#14 User is offline   mattk37 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 16
  • Joined: 16-February 08

Posted 03 December 2008 - 09:09 PM

View Postusasma, on Dec 3 2008, 07:46 PM, said:

Looks like the "close action" and the "also needed to show up on Power Menus" options are what you're looking for:
http://blogs.technet.com/richardsmith/arch...-the-guids.aspx

Let us know if it works for you - I haven't been able to try it on my system yet.


that doesn't seem to have much to do with what i am saying...

here is a reg file i made, but it says that the keys are in use :huh:

Windows Registry Editor Version 5.00

[HKEY_USERS\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
"SystemPowerPolicy"=hex:01,00,00,00,00,00,00,00,03,00,00,00,08,00,00,00,00,00,00,00,03,\
  00,00,00,08,00,00,00,02,00,00,00,03,00,00,00,00,00,00,00,02,00,00,00,03,00,\
  00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,01,00,00,\
  00,00,00,00,00,01,00,00,00,03,00,00,00,03,00,00,00,04,00,00,C0,01,00,00,00,\
  05,00,00,00,01,00,00,00,0A,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,\
  00,12,00,00,00

  [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\4f971e89-eebd-4455-a8de-9e59040e7347\7648efa3-dd9c-4e3e-b566-50f929386280]
"ACSettingIndex"=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c\4f971e89-eebd-4455-a8de-9e59040e7347\7648efa3-dd9c-4e3e-b566-50f929386280]
"ACSettingIndex"=dword:00000004

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\a1841308-3541-4fab-bc81-f71556f20b4a\4f971e89-eebd-4455-a8de-9e59040e7347\7648efa3-dd9c-4e3e-b566-50f929386280]
"ACSettingIndex"=dword:00000004

[HKEY_USERS\S-1-5-21-650302481-2879485454-116807313-1000\Control Panel\PowerCfg\GlobalPowerPolicy]
"Policies"=hex:01,00,00,00,00,00,00,00,03,00,00,00,08,00,00,00,00,00,00,00,03,\
  00,00,00,08,00,00,00,02,00,00,00,03,00,00,00,00,00,00,00,02,00,00,00,03,00,\
  00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,01,00,00,\
  00,00,00,00,00,01,00,00,00,03,00,00,00,03,00,00,00,04,00,00,C0,01,00,00,00,\
  05,00,00,00,01,00,00,00,0A,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,\
  00,12,00,00,00
  
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
"AcPolicy"=hex:01,00,00,00,00,00,00,00,03,00,00,00,08,00,00,00,02,00,00,00,03,\
  00,00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,FF,FF,\
  FF,FF,02,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,32,00,00,80,04,00,00,\
  00,04,00,00,00,04,00,00,00,00,00,00,00,40,00,00,00,00,00,00,00,03,00,00,00,\
  01,00,00,00,03,00,00,00,03,00,00,00,04,00,00,C0,01,00,00,00,05,00,00,00,01,\
  00,00,00,0A,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,B0,04,00,00,\
  00,00,00,00,90,E8,07,00,50,D9,90,7C,D0,E7,07,00,00,00,00,00,00,64,64,00,02,\
  00,00,00,04,00,00,C0,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power]
"AcPolicy"=hex:01,00,00,00,00,00,00,00,03,00,00,00,08,00,00,00,02,00,00,00,03,\
  00,00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,FF,FF,\
  FF,FF,02,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,32,00,00,80,04,00,00,\
  00,04,00,00,00,04,00,00,00,00,00,00,00,40,00,00,00,00,00,00,00,03,00,00,00,\
  01,00,00,00,03,00,00,00,03,00,00,00,04,00,00,C0,01,00,00,00,05,00,00,00,01,\
  00,00,00,0A,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,B0,04,00,00,\
  00,00,00,00,90,E8,07,00,50,D9,90,7C,D0,E7,07,00,00,00,00,00,00,64,64,00,02,\
  00,00,00,04,00,00,C0,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
"DcPolicy"=hex:01,00,00,00,00,00,00,00,03,00,00,00,08,00,00,00,02,00,00,00,03,\
  00,00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,FF,FF,\
  FF,FF,02,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,32,00,00,80,04,00,00,\
  00,04,00,00,00,04,00,00,00,00,00,00,00,40,00,00,00,00,00,00,00,03,00,00,00,\
  01,00,00,00,03,00,00,00,03,00,00,00,04,00,00,C0,01,00,00,00,05,00,00,00,01,\
  00,00,00,0A,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,B0,04,00,00,\
  00,00,00,00,90,E8,07,00,50,D9,90,7C,D0,E7,07,00,00,00,00,00,00,64,64,00,02,\
  00,00,00,04,00,00,C0,00,00,00,00

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power]
"DcPolicy"=hex:01,00,00,00,00,00,00,00,03,00,00,00,08,00,00,00,02,00,00,00,03,\
  00,00,00,00,00,00,00,02,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,FF,FF,\
  FF,FF,02,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,32,00,00,80,04,00,00,\
  00,04,00,00,00,04,00,00,00,00,00,00,00,40,00,00,00,00,00,00,00,03,00,00,00,\
  01,00,00,00,03,00,00,00,03,00,00,00,04,00,00,C0,01,00,00,00,05,00,00,00,01,\
  00,00,00,0A,00,00,00,00,00,00,00,03,00,00,00,01,00,01,00,01,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,00,00,B0,04,00,00,\
  00,00,00,00,90,E8,07,00,50,D9,90,7C,D0,E7,07,00,00,00,00,00,00,64,64,00,02,\
  00,00,00,04,00,00,C0,00,00,00,00




is there a way to add the file to the registry before logon?

#15 User is offline   usasma 

  • Still visually handicapped, new avatar (a camel) :0)
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 16,689
  • Joined: 02-October 05
  • Gender:Male
  • Location:Southeastern CT, USA

Posted 04 December 2008 - 06:14 AM

This free tool should do it - http://home.eunet.no/pnordahl/ntpasswd/
Also, I believe you can do it in the Recovery Console (DOS prompt)
Also in Bart PE.
- John
**If you need a more detailed explanation, please ask for it. I have the Knack. **

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users