Set the Power Button Function in Windows
In order to avoid the problems and resulting troubleshooting associated with doing a hard PC shutdown, today’s computers have programmable power buttons. The computer comes with a factory setting to execute one of the Windows shutdown options when the power button is pushed, instead of just turning off the power. But you can change the setting to any of the shutdown options.
The instructions for setting the power button function are the same in Windows 7 and Vista, but a little different for XP.
To set the Power button’s function, follow these steps for Windows 7 and Windows Vista:
In the Control Panel, choose Hardware and Sound.
Beneath the Power Options heading, click the Change What the Power Buttons Do link.
You may see only the column for Plugged In. The On Battery column shows up only for a laptop, which is battery powered, as well as for a desktop PC connected to an uninterruptible power supply (UPS). For the On Battery power options to appear, your PC must be connected to a UPS by using a USB cable.
A second row may also appear, When I press the sleep button. That row appears for those few PC models that feature a specific Sleep button.
Click a button to choose a Plugged In Power button function.
The button in the Plugged In column, the Power button row, features a pop-up menu with up to four options: Do Nothing, Sleep, Hibernate, and Shut Down. Choose which command you want the PC’s Power button to execute when you press that button while the computer is on.
Set additional Power button functions.
When your computer features a Sleep button, set its function by clicking the button and choosing a command.
You can also choose functions for the Power button (or buttons) when the computer is on battery power.
Click the Save Changes button.
Close the System Settings window.
These steps are demonstrated in this video.
Follow these steps to set the Power button’s function in Windows XP:
Open the Control Panel’s Power Options icon.
The Power Options Properties dialog box appears.
Click the Advanced tab.
In the Power Buttons area, choose the Power button’s function from the drop-down list beneath When I Press the Power Button on My Computer.
The five options are Do Nothing, Ask Me What to Do, Stand By, Hibernate, and Shut Down.
The Ask Me What to Do option displays the standard Shutdown window.
Click OK and close the Control Panel window.
You must have hibernation activated before you can use hibernation as an option for the Power button.
You can assign the Power button to hibernate the computer in Windows 7 or in Windows Vista, even when hybrid sleep is active.