A notable fact is that every time a laptop lid is closed, the system goes to sleep. The user must press the power button to wake it up and may need to log into the device again. This is the default setting for Windows 10 systems and is intended to save battery life when the system is not in use.
However, it may not be absolutely favorable for users who find it annoying to log into the system every time. Some others may have to completely hide their data by shutting down the system by closing the lid. Windows 10 gives users options to choose what happens when they close the lid of their laptop.
Method 1: using the power options
1] The right mouse button on him battery icon in the lower right corner of the screen and select Power options.
2] In the list on the left, click on the option "Choose what closing the lid does. "
3] In the "When I close the lid section“, Choose the action when closing the lid for the statuses of battery connected and turned on.
4] Click Save Changes to save the new settings.
Method 2 - Using advanced power options
1] Press Win + R to open the Run window and type the command powercfg.cpl. Press Enter to open the Power Options window.
2] Click Change your plan settings corresponding to the currently selected power plan.
3] Select Change advanced power settings and in the window that opens expand the power buttons and the lid. Then expand the lid close action and change the On Battery and Connected settings.
4] Click Apply and OK.
Method 3 - Using the command prompt
In case the above 2 methods fail, which rarely happens, we could try to change the settings via the command prompt.
1] Press Win + R to open the Run window and type the command cmd. Press Enter to open the Command Prompt window.
2] Type the following command in the command prompt window and press Enter:
If your system is battery powered:
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 Index_Number
If the power cord is connected in the system:
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 Index_Number
il Index number must be replaced by the following values:
0: do nothing
3: turn off
To save the changes, use the following command:
powercfg -SetActive SCHEME_CURRENT
Press Enter and reboot the system.