In Windows 10, it is possible to set the default action for the hardware power button of your PC or laptop. When you press it, the operating system can perform one of the following actions: do nothing, shut down, turn off the display, sleep, or hibernate. Let's see how to configure this feature.
In Windows 10, the hardware power button action is connected with the current power plan, so the user can configure it separately for each power plan available in the OS. The configuration can be done with the classic Control Panel, using the Power Options applet, or with the console tool powercfg. We will review all of these methods.
Change Power Button Action with Control Panel
To change the hardware power button action in Windows 10 using the Control Panel, do the following.
- Open Control Panel.
- Go to Control Panel\Hardware and Sound\Power Options.
- On the left, click the link Choose what the power buttons do.
- In the drop down list When I press the power button, select the desired action. If you are using a laptop, configure this option for both "On battery" and "Plugged in".
Change Power Button Action in Power Options
The classic Power Options applet can be used to set the desired action for the hardware shutdown button. Here is how.
- Open Settings.
- Go to System - Power & sleep.
- On the right, click on the link Additional power settings.
- In the next window, expand Power buttons and lid -> Power button action. Select the desired action.
Change Power Button Action with powercfg
There is a built-in tool in Windows 10, powercfg. This console utility can adjust many parameters related to power management. For example, powercfg can be used:
- To sleep Windows 10 from the command line
- To change the power plan from the command line or with a shortcut
- To disable or enable the Hibernate mode.
Powercfg can be used to set the desired action for the hardware power button. Here is how.
- Open a command prompt.
- Type or copy-paste the following command:
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 THE_DESIRED_ACTION
To find the required "THE_DESIRED_ACTION" value, see the Note below.
This will set the desired action for the hardware power button when your device is plugged in.
To set the same when on battery, execute
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 THE_DESIRED_ACTION
- Activate the changes you made with the command:
powercfg -SetActive SCHEME_CURRENT
Note: In the command above, you need to replace the THE_DESIRED_ACTION portion with one of the following values.
0 - Do nothing
1 - Sleep
2 - Hibernate
3 - Shut down
4 - Turn off the display.
Tip: The SCHEME_CURRENT identifier makes powercfg modify the current power plan. If you need to modify another power plan instead of the current one, you need to use its identifier. To find the required identifier, run the following command:
Then the modification command will looks as follows:
When plugged in:
powercfg -setacvalueindex GUID 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 Index
When on battery:
powercfg -setdcvalueindex GUID 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 Index
The next command sets the action "Do nothing" for the High performance power plan when plugged in.
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!