You can choose what happens, when you press the power button on your computer case (or the edge of a laptop). The computer can shut down, sleep, hibernate, or do nothing. You can apply the same setting to all of your power plans or you can apply different settings to individual power plans.
To apply the same setting to all power plans
1. First Goto Control Panel to open Power Options.
2. On "Select a power plan" page, in the left pane,
click Choose what the power buttons do.
3. On "Define power buttons and turn on password protection
page", next to When I press the power button, choose what
you want your computer to do when you press the power button.
If you have a laptop,
you can choose separate settings for when your laptop is running on battery and
when it's plugged in

