Change Default Action of Power Button in Windows 10  

Page 1 of 2 12 LastLast
    Change Default Action of Power Button in Windows 10

    Change Default Action of Power Button in Windows 10

    How to Change Default Action of Power Button in Windows 10
    Published by Category: Performance & Maintenance
    15 Jun 2021
    Designer Media Ltd

    How to Change Default Action of Power Button in Windows 10


    The Power button action setting in Power Options lets users specify the default action to take when the system hardware power button on the PC is pressed.

    Users can specify one of the following actions to take: do nothing, sleep, hibernate, shut down, or turn off the display.

    This tutorial will show you how to change the default action to take when users press the PC case hardware power button in Windows 10.


    Contents

    • Option One: To Change Default Power Button Action in Power Options
    • Option Two: To Change Default Power Button Action in Advanced Power Options
    • Option Three: To Change Default Power Button Action for Current Power Plan in Command Prompt
    • Option Four: To Change Default Power Button Action for Specific Power Plan in Command Prompt
    • Option Five: To Specify Default Power Button Action in Local Group Policy Editor
    • Option Six: To Specify Default Power Button Action using a REG file






    OPTION ONE

    To Change Default Power Button Action in Power Options


    1 Open Power Options. (see screenshot below)

    Change Default Action of Power Button in Windows 10-open_power_options.jpg

    2 Click/tap on the Choose what the power buttons do or Choose what the power button does link on the left side. (see screenshot below)

    Change Default Action of Power Button in Windows 10-change_power_button_action-1.png

    3 In the When I press the power button drop menus, select the action you want, and click/tap on Save changes. (see screenshot below)

    Change Default Action of Power Button in Windows 10-change_power_button_action-2.png

    4 Restart the computer to apply.






    OPTION TWO

    To Change Default Power Button Action in Advanced Power Options


    1 Open Advanced Power Options.

    2 Expand open Power buttons and lid and Power button action. (see screenshot below)

    3 Select the action you want, and click/tap on OK. (see screenshot below)

    4 Restart the computer to apply.

    Change Default Action of Power Button in Windows 10-change_power_button_action-3.png






    OPTION THREE

    To Change Default Power Button Action for Current Power Plan in Command Prompt


    1 Open a command prompt.

    2 Type the command below you want to use into the command prompt, and press Enter. (see screenshot below)

    (On battery)
    powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 Index

    OR

    (Plugged in)
    powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 Index

    Substitute Index in the command above with the number in the table below for the default action you want set for the power button.

    For example:

    powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0


    Index Number Action
    0 Do nothing
    1 Sleep
    2 Hibernate
    3 Shut down
    4 Turn off the display

    3 Copy and paste the powercfg -SetActive SCHEME_CURRENT command into the command prompt, and press Enter to apply the change. You can now close the command prompt if you like.

    4 Restart the computer to apply.

    Change Default Action of Power Button in Windows 10-current_power_button_command.png






    OPTION FOUR

    To Change Default Power Button Action for Specific Power Plan in Command Prompt


    1 Open a command prompt.

    2 Copy and paste the powercfg /L command below into the command prompt, and press Enter. Make note of the GUID number (ex: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c) of the power plan you want to apply this to. (see screenshot below)

    The power plan (ex: High performance) with a * to the right of it is your current active power plan scheme.

    Change Default Action of Power Button in Windows 10-change_power_button_action_command-1.png

    3 Type the command below you want to use into the command prompt, and press Enter. (see screenshot below)

    (On battery)
    powercfg -setdcvalueindex GUID 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 Index

    OR

    (Plugged in)
    powercfg -setacvalueindex GUID 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 Index

    Substitute GUID in the command above with the actual GUID from step 2 above for the power plan you want to apply this to.

    Substitute Index in the command above with the number in the table below for the default action you want set for the power button.

    For example: Set to "Do nothing" for the High performance power plan GUID (8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c)

    powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0


    Index Number Action
    0 Do nothing
    1 Sleep
    2 Hibernate
    3 Shut down
    4 Turn off the display

    Change Default Action of Power Button in Windows 10-change_power_button_action_command-2.png

    4 Type the command below into the command prompt, and press Enter to apply the change. (see screenshot below)

    This command will set the power plan for the GUID as your active scheme. If you do not want this power plan to be set as your active scheme, then you can restart the computer to apply the changes instead of doing this step.


    powercfg -SetActive GUID

    Substitute GUID in the command above with the same GUID from step 2 above for the power plan you want to apply this to.

    For example: powercfg -SetActive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

    Change Default Action of Power Button in Windows 10-change_power_button_action_command-3.png

    5 Restart the computer to apply.






    OPTION FIVE

    To Specify Default Power Button Action in Local Group Policy Editor


    You must be signed in as an administrator to do this option.

    The Local Group Policy Editor is only available in the Windows 10 Pro, Enterprise, and Education editions.

    If this policy is enabled, it will override and gray out Option One, Option Two, Option Three, and Option Four.

    All editions can use Option Six below.


    1 Open the Local Group Policy Editor.

    2 In the left pane of the Local Group Policy Editor, click/tap on to expand Computer Configuration, Administrative Templates, System, Power Management, and Button Settings. (see screenshot below)

    Change Default Action of Power Button in Windows 10-default_power_button_action_gpedit-1.png

    3 In the right pane of Button Settings, double click/tap on the Select the Power button action (plugged in) and/or Select the Power button action (on battery) policy you want to edit. (see screenshot above)

    4 Do step 5 (default), step 6 (hibernate), step 7 (shut down), step 8 (sleep), or step 9 (Take no action) below for which default action you want to specify.


    5 Default User Choice for Power Button Action

    This will allow users to use Option One, Option Two, Option Three, and Option Four.

    A) Select (dot) Not Configured, click/tap on OK, and go to step 10 below. (see screenshot below step 9)

    6 To Specify "Hibernate" for Power Button Action

    A) Select (dot) Enabled, select Hibernate in the Power Button Action drop menu under Options, click/tap on OK, and go to step 10 below. (see screenshots below step 9)


    7 To Specify "Shut down" for Power Button Action

    A) Select (dot) Enabled, select Shut down in the Power Button Action drop menu under Options, click/tap on OK, and go to step 10 below. (see screenshots below step 9)


    8 To Specify "Sleep" for Power Button Action

    A) Select (dot) Enabled, select Sleep in the Power Button Action drop menu under Options, click/tap on OK, and go to step 10 below. (see screenshots below step 9)


    9 To Specify "Take no action" for Power Button Action

    A) Select (dot) Enabled, select Take no action in the Power Button Action drop menu under Options, click/tap on OK, and go to step 10 below. (see screenshots below)

    Change Default Action of Power Button in Windows 10-default_power_button_action_gpedit-2.png Change Default Action of Power Button in Windows 10-default_power_button_action_gpedit-3.png


    10 When finished, you can close the Local Group Policy Editor if you like.






    OPTION SIX

    To Specify Default Power Button Action using a REG file


    You must be signed in as an administrator to do this option.

    If this policy is enabled, it will override and gray out Option One, Option Two, Option Three, and Option Four.

    The downloadable .reg files below will add and modify the DWORD values in the registry key below.

    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280

    ACSettingIndex DWORD

    (delete) = Default user choice (Not configured)
    0 = Take no action
    1 = Sleep
    2 = Hibernate
    3 = Shut down

    DCSettingIndex DWORD

    (delete) = Default user choice (Not configured)
    0 = Take no action
    1 = Sleep
    2 = Hibernate
    3 = Shut down


    1 Do step 2 (default), step 3 (hibernate), step 4 (shut down), step 5 (sleep), or step 6 (Take no action) below for which default action you want to specify.


     2. Default User Choice for Power Button Action

    This will allow users to use Option One, Option Two, Option Three, and Option Four.

    A) Click/tap on the Download button you want below to download the plugged in AND/OR on battery file below, and go to step 7 below.

    Default_user_choice_for_power_button_action-plugged-in.reg

    Download

    AND/OR

    Default_user_choice_for_power_button_action-on-battery.reg

    Download


     3. To Specify "Hibernate" for Power Button Action

    A) Click/tap on the Download button you want below to download the plugged in AND/OR on battery file below, and go to step 7 below.

    Specify_hibernate_for_power_button_action-plugged-in.reg

    Download

    AND/OR

    Specify_hibernate_for_power_button_action-on-battery.reg

    Download



     4. To Specify "Shut down" for Power Button Action

    A) Click/tap on the Download button you want below to download the plugged in AND/OR on battery file below, and go to step 7 below.

    Specify_shut_down_for_power_button_action-plugged-in.reg

    Download

    AND/OR

    Specify_shut_down_for_power_button_action-on-battery.reg

    Download


     5. To Specify "Sleep" for Power Button Action

    A) Click/tap on the Download button you want below to download the plugged in AND/OR on battery file below, and go to step 7 below.

    Specify_sleep_for_power_button_action-plugged-in.reg

    Download

    AND/OR

    Specify_sleep_for_power_button_action-on-battery.reg

    Download


     6. To Specify "Take no action" for Power Button Action

    A) Click/tap on the Download button you want below to download the plugged in AND/OR on battery file below, and go to step 7 below.

    Specify_do_nothing_for_power_button_action-plugged-in.reg

    Download

    AND/OR

    Specify_do_nothing_for_power_button_action-on-battery.reg

    Download


    7 Save the .reg file to your desktop.

    8 Double click/tap on the downloaded .reg file to merge it.

    9 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

    10 You can now delete the downloaded .reg file if you like.


    That's it,
    Shawn Brink






  1. Posts : 91
    10 pro
       #1

    Do you know of any issues with this in W10 v1909? I have both Power and Sleep button actions set to "Do nothing", but the power key on the keyboard now causes an immediate shutdown, which causes serious loss of work if something bumps that key accidentally. This setting was working properly in v1809.
      My Computer


  2. Posts : 68,866
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    SpacemanSam said:
    Do you know of any issues with this in W10 v1909? I have both Power and Sleep button actions set to "Do nothing", but the power key on the keyboard now causes an immediate shutdown, which causes serious loss of work if something bumps that key accidentally. This setting was working properly in v1809.
    Hello Sam,

    You might check to see if there may be some BIOS or OEM power management software installed that could be set and overriding this.
      My Computers


  3. Posts : 91
    10 pro
       #3

    Yep, that was it.
    Repeated attempts at updating Windows had failed, and the last attempt glitched and prevented Windows from booting any further than the recovery console. None of the recovery options worked. So there was nothing else I could do except a clean reinstall. But I forgot to install the OEM drivers for this mobo. That was the problem. Once I installed the mobo chipset driver, powercfg disables the keyboard "Power" key as it should.
      My Computer


  4. Posts : 68,866
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Great news.
      My Computers


  5. Posts : 91
    10 pro
       #5

    Now that that problem is solved, I can go ahead and send you this:

    You can replace the GUIDs in the powercfg command with their friendly names. That makes the code more readable.
    4f971e89-eebd-4455-a8de-9e59040e7347 --> SUB_BUTTONS
    7648efa3-dd9c-4e3e-b566-50f929386280 --> PBUTTONACTION

    You can also specify the sleep button action by specifying SBUTTONACTION instead of PBUTTONACTION.

    To set the desired actions for all power plans implemented on your computer, use the following batch code:

    Code:
    REM Set the following according to what you want.
    SET "WakeLogin=0" & REM 0 = Disabled, 1 = Enabled
    SET "KbdPowerKey=0" & REM 0 = Do nothing, 1 = Sleep, 2 = Hibernate, 3 = Shut down, 4 = Turn off the display
    SET "KbdSleepKey=0" & REM 0 = Do nothing, 1 = Sleep, 2 = Hibernate, 3 = Shut down, 4 = Turn off the display
    
    for /f "skip=2 tokens=4*" %%i in ('powercfg /list') do (
      IF "%%j" == "" (powercfg /d %%i) ELSE (
      powercfg -SETACVALUEINDEX %%i SUB_NONE CONSOLELOCK %WakeLogin%
      powercfg -SETDCVALUEINDEX %%i SUB_NONE CONSOLELOCK %WakeLogin%
      powercfg -SETACVALUEINDEX %%i sub_buttons lidaction 0 & REM On AC, do nothing when lid closes
      powercfg -SETDCVALUEINDEX %%i sub_buttons lidaction 1 & REM On DC, go to sleep when lid closes
      powercfg -SETACVALUEINDEX %%i sub_buttons PBUTTONACTION %KbdPowerKey% & REM On AC, what to do when power key is pressed
      powercfg -SETDCVALUEINDEX %%i sub_buttons PBUTTONACTION %KbdPowerKey% & REM On DC, what to do when power key is pressed
      powercfg -SETACVALUEINDEX %%i sub_buttons SBUTTONACTION %KbdSleepKey% & REM On AC, what to do when sleep key is pressed
      powercfg -SETDCVALUEINDEX %%i sub_buttons SBUTTONACTION %KbdSleepKey% & REM On DC, what to do when sleep key is pressed
      )
    )
    I have this in my ConfigureWindows.bat file which I run on every new install. The three SET commands are in a separate section at the top (along with other settings that can be configured per installation).
    Last edited by SpacemanSam; 08 Apr 2020 at 13:06. Reason: Fixed explanations of what the setting values do
      My Computer


  6. Posts : 68,866
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #6

      My Computers


  7. Posts : 3
    Windows 10
       #7

    Hey guys,

    I just tried "To Change Default Power Button Action for Current Power Plan in Command Prompt" option on my Microsoft Windows [Version 10.0.19041.450] and it does not seem to work - when I check if the options are changed in Control Panel after the commands have been executed, no change in the values for the Power Button is recorded.

    I need to set the power button to do nothing:

    powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0

    Any suggestions?
      My Computer


  8. Posts : 68,866
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #8

    bartdivanov said:
    Hey guys,

    I just tried "To Change Default Power Button Action for Current Power Plan in Command Prompt" option on my Microsoft Windows [Version 10.0.19041.450] and it does not seem to work - when I check if the options are changed in Control Panel after the commands have been executed, no change in the values for the Power Button is recorded.

    I need to set the power button to do nothing:

    powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0

    Any suggestions?
    Hello Bart, and welcome to Ten Forums.

    If this is for the tablet in your specs, then it's most likely a hardware or firmware override.
      My Computers


  9. Posts : 3
    Windows 10
       #9

    Brink said:
    Hello Bart, and welcome to Ten Forums.

    If this is for the tablet in your specs, then it's most likely a hardware or firmware override.
    Thanks, thanks for your welcome!

    Yes, this is exactly for a tablet Zebra R12. I am trying this for days with not luck..

    I can actually do this using Control Panel manually, and this is a custom power scheme.
      My Computer


 

Tutorial Categories

Change Default Action of Power Button in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:50.
Find Us




Windows 10 Forums