How to customize power button action when pressed on Windows 10

Although nowadays it's more common to use the power options in the Start menu to shut down Windows 10, there are still many users who feel more comfortable pressing the hardware power button to turn off their computers.

If you're in the group of users who prefer to use the physical button, you can also change its behavior to either do absolutely nothing, sleep, hibernate, shut down, or turn off the display when you press it. Something that can come in handy in many scenarios, for example, if you have a tablet, and you want it to hibernate instead of sleep to save battery life. Or on a desktop PC, you may prefer to use sleep mode instead of shutting down to resume the device more quickly.

In this Windows 10 guide, we'll walk you through the steps to change the power button action on your device using Control Panel and Command Prompt.

How to change power button action using Control Panel

  1. Open Control Panel.
  2. Click on System and Security.
  3. Under "Power Options," click the Change what the power buttons do link.
  4. Using the drop-down menu for "When I press the power button" select the action you want:
    • Do nothing.
    • Sleep.
    • Hibernate.
    • Shut down.
    • Turn off the display.
  5. Click the Save changes button at the bottom of the window.

Once you completed the steps, every time you press the power button your computer will respond to the new action.

Depending on the hardware and device you own the settings available will be different. For example, the hibernation power state is not a feature supported on every system, which means that depending on the hardware this option may not be available. In addition, on laptops and other mobile devices like Surface Pro, you can define the power button action when it's plugged in and when it's running on battery.

How to change power button action using Command Prompt

If you prefer using command lines, it's also possible to use Command Prompt to define a new action for the power button.

  1. Open Start.
  2. Search for Command Prompt, right-click the result, and select Run as administrator.
  3. Type the following command to change the default action for the power button and press Enter:To change the default action when your computer is plugged in, use the following command:powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0To change the default action when your computer is on battery, use the following command:powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 0You'll notice in the examples, both commands end up with a value of "0", this is the index value that defines the action, and you must change it to reflect what you want the power button to do.Here are the available values you can use with their repective action:
    • 0 -- Do nothing.
    • 1 -- Sleep.
    • 2 -- Hibernate.
    • 3 -- Shut down.
    • 4 -- Turn off the display.
    If your computer doesn't have support for hibernation, remember not to use the index value of 2.
  4. Type the following command to apply the changes and press Enter:powercfg -SetActive SCHEME_CURRENT

After completing the steps, the next time you press the power button your device will respond to the new action.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

Mauro Huculak

Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.