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.

Latest in Windows 10
Windows 10 Find My Device
How to enable Find My Device on Windows 10 to recover your PC if it's ever lost or stolen
Outlook Client Hero
Microsoft just made Windows 10 worse, and there's (almost) nothing you can do about it
Windows 10 Start menu on HP ZBook Studio G4
Microsoft will retroactively downgrade this part of Windows 10 next month
Former Microsoft Executive Vice President Terry Myerson stands in front of a presentation about Windows 10
Microsoft addresses the 'elephant in the room,' discusses upcoming end of Windows 10 support
Surface Hub 2S
Windows 10 for PCs is not the only version of Windows to reach end of support this year
Windows Insider program settings
Microsoft shuts down the Windows 10 Beta Channel just five months after reopening it
Latest in How-to
Atomfall
Can I play Atomfall on Steam Deck, ROG Ally, and other gaming handhelds?
Windows 11 answer file
How to easily create an unattended answer file for Windows 11
The First Berserker: Khazan
Is The First Berserker: Khazan on Xbox Game Pass?
Clair Obscur: Expedition 33
Is Clair Obscur: Expedition 33 on Xbox Game Pass?
A close-up of Hazel in South of Midnight
Is South of Midnight on Xbox Game Pass?
Atomfall screenshot
Atomfall: How to grab the best melee weapon and melee perk right away