By default, Windows 7 assumes you are done with your computer with you shut the lid. That means, it will either shut down or go to sleep. If you only need to close the lid when walking to class, or to move to another room, you probably don't want the computer shutting down. Luckily, Windows 7 allows you to choose what action, if any, should occur when you close your laptop.
Click the "Start" button and type "power options."
Click "Power Options" in the search results.
Click "Choose what closing the lid does" in the left pane of the "Power Options" window.
Click the drop-down menus next to "When I close the lid" and select "Do nothing" in both the "On battery" and "Plugged in" columns. This keeps your laptop in an active state when you close the lid.