Defining what power buttons do is needed after you bought a new computer. Usually the power button sleeps instead of shutting down.
We will tackle two different methods to access the power settings. The changes we will make to the settings will be applied to all power plans.
Click the Power Icon and choose “More power options”
Once the power option window opens, at the left pane click “Choose what the power buttons do” option.
For the next window, we can now change the settings for the power button, sleep button and closing of the lid for both On Battery and Plugged In.
For this method, open the command prompt (cmd.exe) and type “powercfg.cpl,0” as shown below:
Microsoft Windows [Version 6.1.7601]
For the command, the advanced power option window will appear and just scroll down for the “Power buttons and lid” to configure the sleep, lid close and shutdown action.