When you plan to keep your laptop in one spot and you’ve attached an external keyboard, mouse, and monitor, you can get away with closing the laptop’s lid and using only the full-size desktop computer
To ensure that the laptop doesn’t sleep or hibernate when you close the lid, you configure the system so that the laptop does nothing when the lid is closed. Follow these steps:
Open the Control Panel.
Press Win+X to summon the supersecret shortcut menu. Choose Control Panel.
Click the Hardware and Sound category.
Click the link labeled Change What the Power Buttons Do.
The link is located beneath the Power Options heading.
In the Power Options System Settings window, locate the When I Close the Lid row and click the button in the Plugged In column.
It’s the lower right button in the set of six buttons.
Choose Do Nothing.
This action directs the laptop to do nothing when the power is on, the laptop is plugged in, and you close the lid.
You shouldn’t choose this same option from the On Battery column. Ensure that the laptop either hibernates, sleeps, or shuts down when you close the lid on battery power.
Click the Save Changes button.
Close the System Settings window.
Of course, you may have to open the laptop to turn it on, but after it’s on, you can close the lid and use the keyboard, monitor, and mouse just like you do on a desktop computer.