A laptop running Windows 7 can be configured to go to Sleep, Hibernate or even shutdown upon closing the lid of the laptop; here is how you can set it.
At the same time, the power button on the body of the laptop (or desktop), the sleep button on the keyboard can be configured too. Not only that, you can set separate action when the laptop is running on battery or on AC power. Suppose, you can set your laptop to Hibernate when you close the lid of the laptop while you are using battery and Shut down when you close the lid of the laptop when the AC power cable is attached.
It is very easy. Click Start orb. Type “power options” (without quotes) in the search field and press enter. Power Options Window will open, click on the link saying “Choose what closing the lid does” :
---

Another Window will open, change two sets of options (on Battery and on AC power) for the closing lid action, power button, sleep button in case of laptop. In case of desktop only one set of option will appear for obvious reason:

The Window is quite self explanatory, so we are not going to more detail! Just to remind you: Do not forget to click “Save Changes” button before closing the Window:
