How to customize power button action when pressed on Windows 10
You can change the default action of your PC's power button, and in this guide, we'll show you how to do it.
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
- How to change power button action using Command Prompt
How to change power button action using Control Panel
- Open Control Panel.
- Click on System and Security.
- Under "Power Options," click the Change what the power buttons do link.
- Using the drop-down menu for "When I press the power button" select the action you want:
- Do nothing.
- Shut down.
- Turn off the display.
- 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.
- Open Start.
- Search for Command Prompt, right-click the result, and select Run as administrator.
- 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.
- 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:
- Windows 10 on Windows Central – All you need to know
- Windows 10 help, tips, and tricks
- Windows 10 forums on Windows Central
Windows Central Newsletter
Get the best of Windows Central in your inbox, every day!
Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.
Is it possible to lock the PC on lid close? I'll really appreciate such functionality!
If you have the laptop set to do nothing when you close the lid, just press Windows Key + L first, then close the lid.
Yeah, that's what I do now, but I'll be glad if I can skip the pressing of Win+L and just close the lid :)
Pretty sure this is in the control panel power options
If set to ask require password when waking from sleep, but I believe he just wanted it to lock.
The power button should be programmable to perform the actions listed on-a-fly....i.e., push timing and tapping.