How to Keep Your Laptop On With the Lid Closed on Windows 10
To change the default behavior of Windows 10 when you close the lid, right-click the battery icon in the system tray, and then click on “Power Options.”
If you don’t see the battery icon, click on “Show Hidden Icons” and then right-click on the battery icon—or head to Control Panel > Hardware and Sound > Power Options instead.
Next, click “Choose what closing the lid does” in the pane to the left.
From the drop-down menu for “When I close the lid,” select “Do Nothing.”
There are two separate options here: On Battery and Plugged In. You can choose different options for each. For example, you might want to have your laptop stay on when you close the lid while it’s plugged in but go to sleep when it’s on battery.
After you’ve made the changes, click “Save changes” and close the Control Panel.
You should now be able to close the lid on your laptop without it going into sleep mode. If you want to switch either of the settings back to the default, head back to the Control Panel > Hardware and Sound > Power Options and change it back.