When you are using your laptop as the desktop replacement at home or just wanting movies from Netflix using your laptop on your HDTV, you may want to keep your laptop on and running even when the lid is closed.
Click on the power icon on the right side of windows taskbar and click on More power options.
Click on Change plan settings on the selected power plan. Click change advanced power settings.
In the power options window, expand Power buttons and lid and Lid close action.
Change it to Do nothing on both On battery and Plugged in based on your preference.
Click Ok. Now you should be able to enjoy your laptop as the perfect desktop replacement.