The power button can do more than just shut down your computer, even though that's what it does by default on most laptops. You can choose what the PC power button does when it is pressed, such as do nothing, go to sleep, hibernate, turn off the display, or shut down.

Changing the power button action is very easy, regardless of the method you use. It takes less than a minute, and laptop users can even change the settings for each power mode.

There are many ways to change the power button settings, each with a different priority. In this guide, we included 4 ways to do this, read carefully and choose the one that best suits your needs.

Using Power Options

Power Options is a Control Panel feature that allows you to change the power settings for your computer. Changing the power button behavior in Windows 11 needs administrator privileges, so make sure to log in to an administrator account before changing the settings.

To customize the behavior of your power button in Windows 11, follow these steps:

  1. Start by opening the Control Panel on your Windows 11 system by searching for 'Control Panel' in the Start menu.
  2. When the Control Panel opens, navigate to the 'Hardware and Sound' category.
  1. Under Hardware and Sound, find the 'Power Options' section and click on 'Change what the power buttons do' link.
  1. On the next page, you'll be able to set your preferred power settings. From the drop-down menu labeled "When I press the power button," select an action for both 'On battery' and 'Plugged in' PCs. You can choose from the following options:
  • Do Nothing: Nothing happens when you press the power button. This can be useful if you want to avoid accidentally turning off your computer.
  • Sleep: Your computer goes into a low-power sleep mode. This means that your computer will use less power, but you will still be able to resume working quickly when you wake it up.
  • Hibernate: Your computer saves your session in a memory disk and shuts down. This means that when you turn your computer back on, it will resume exactly where you left off. Hibernate uses less power than sleep, but it takes longer to wake up from hibernation.
  • Shut Down: This action completely shuts down the PC when the Power button is pressed.
  • Turn off the Display: This turns off your computer's display, but the computer keeps running. This can be useful if you want to save battery power or if you want to avoid accidentally turning off your computer.
  1. After selecting the options, click 'Save changes' to apply the settings.

The power options settings may vary depending on your device. For example, laptop users will have an additional 'When I close the lid' setting. Desktop users may not see the 'Turn off the display' option if their PC doesn't support the S3 standard and has Modern Standby.

Additionally, desktop users will not have separate 'On battery' and 'Plugged-in' power options if their computer doesn't have a UPS connection. Any changes you make to the power options settings will apply to all the power plans.


Using Command Line or PowerShell

If you are comfortable using command line tools such as Windows PowerShell or CMD, you may find it easier to change these settings using that tool.

You can use the command line interface to change the power button action for multiple computers at once, which can be useful for system administrators. You can also use the command line interface to create a script to automate the process of changing the power button action, which can be useful for deploying changes to a large number of computers.

  1. Open Command Prompt or Windows PowerShell with administrative privileges. The following commands will work on either.
  2. Now, paste one of the following commands and hit Enter, depending on the power button action you want to enforce in Windows 11.

Battery settings

1. Do nothing:

powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0
  1. Sleep:
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 1
  1. Hibernate:
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 2
  1. Shut down:
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 3
  1. Turn off Display:
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 4

Plugged in Settings

  1. Do nothing:
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0
  1. Sleep:
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 1
  1. Hibernate:
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 2
  1. Shut down:
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 3
  1. Turn off Display
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 4

In the above command, 4f971e89-eebd-4455-a8de-9e59040e7347 is the GUID of the power settings and 7648efa3-dd9c-4e3e-b566-50f929386280 is the GUID of the power button action. The only thing that changes is the value data at the end.


Using Registry Editor

You can also change the power button's behavior by changing its registry settings. These settings take precedence over the Power Options settings. Before you do, it is recommended to backup all Registry files and create a System Restore point on your system.

How to Create a Restore Point in Windows 11
Create a System Restore Point on your Windows 11 PC and use it to recover your PC if you ever run into critical issues.

To change the power button action in Windows 11 using the registry:

  1. Press Windows+R to open Run, type regedit, and click 'OK' to launch Registry Editor.
  1. Click 'Yes' in the UAC prompt.
  2. Navigate to the below path by using the navigation pane or pasting it into the address bar and pressing Enter:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft
  1. Right-click on the 'Microsoft' key and select 'New' > 'Key'.
  1. Rename the newly created key to 'Power'.
  1. After that, create a new key and rename it to PowerSettings under Power. To do that, right-click 'Power' and select 'New' > 'Key'.
  1. Again, create a new key, this time inside the 'PowerSettings' key, and name it 7648EFA3-DD9C-4E3E-B566-50F929386280. Then, go inside this key. If all these keys already, you can skip these steps and directly go to the 7648EFA3-DD9C-4E3E-B566-50F929386280 key.
  1. With the 7648EFA3-DD9C-4E3E-B566-50F929386280 key selected, right-click on an empty area on the right and select 'New' > 'DWORD (32-bit) Value'.
  1. Then name the DWORD as ACSettingIndex or DCSettingIndex.
  1. ACSettingIndex controls what happens when you press the power button while your computer is plugged in, while DCSettingIndex controls what happens when you press the power button while your computer is on battery. You can also add both keys to the registry, but this is not necessary. If you only add one key, the setting you choose will apply to both plugged-in and battery-powered modes.
  2. To change the power button function in Windows 11 for on battery, double-click or right-click on the ACSettingIndex DWORD and select 'Modify'.
  1. Enter the following value in the Value data field for the desired setting:
  • Sleep: 1
  • Hibernate: 2
  • Shut down: 3
  • Do nothing: 0
  1. To change the power button behavior in Windows 11 for plugged-in, double-click the DCSettingIndex DWORD.
  1. Then, enter the following value in the 'Value data' field for the desired setting:
  • Sleep: 1
  • Hibernate: 2
  • Shut down: 3
  • Do nothing: 0
  1. Remember, these changes will reflect across all power plans (e.g. Balanced, High performance). 

Here is an example of how you could use both keys to set different power button actions for plugged-in and battery-powered modes - ACSettingIndex='3' (Shut down) and DCSettingIndex='2(Hibernate)

This would cause your computer to go to sleep when you press the power button while it is plugged in, and to shut down when you press the power button while it is on battery.


Using Local Policy Editor

Changes you make to the power button settings in the Control Panel will only apply to the current user. This means that other users on the same computer will not be affected by your changes. If you want to change the power button settings for all users on the computer, you can use Group Policy Editor.

Using Group Policy Editor, you can change the power button's behavior by changing its policy settings. These settings override the Power Options settings in the Control Panel. To do this, follow these steps:

  1. Open Group Policy Editor by searching for ‘Local Group Policy Editor’ in the Windows Search, and selecting the relevant result.
  2. In the Group Policy Editor, go to Computer Configuration > Administrative Templates > Windows Components > Power Management > Power Settings.
  1. In the right pane of ‘Button Settings’, double click on the ‘Select the Power button action (plugged in)’ to define what the Power button does when the computer is running on Battery.
  1. Next, choose 'Enabled' from the top left, and then select the desired action from the ‘Power Button Action’ dropdown menu below.
  1. After that, click ‘Apply’ and then ‘OK’.
upload in progress, 0
  1. Next, click the ‘Select the Power button action (on battery)' policy to set what the Power button does when the PC is plugged in.
  1. Select ‘Enabled’ from the top left, select the desired action from the ‘Power Button Action’ dropdown menu, and click 'Apply' and 'OK' to save the settings.

The Local Group Policy Editor also includes policies for other settings, such as lid shutdown on laptops. If you don't have the Local Group Policy Editor on your PC, check your OS edition. If it's Windows 11 Home, you can use the above methods to change the Power button settings. Any changes you make will apply to all power plans.

That's it.