Set power button behavior

By default, pressing the power button puts the computer to sleep mode. However, you can change the power button behavior in Windows Control Panel.
  1. Type Control Panel in the Windows search box and then press Enter. Open the control panel and view by large or small icons.
  2. Select the power options and then click choose what the power button does.