.all the tips I have read has been useless. I have given up.
Install Win 7 on a different PC using the same DVD, if it just works fine then its the problem with your laptop or desktop, could be your H/W or H/W drivers.. contact your H/W vendor.
If Win 7 behaves the same on a different PC as well then its the problem with the Windows copy.. contact Microsoft.
But, try this just in case..
Go to , Control Panel\Hardware and Sound\Power Options\Edit Plan Settings and click on "change advanced power settings"
you'll get a pop up box and find for an option "Power buttons and lid" and Power button action" and see what that setting says, it should read "Shut down".
Will be glad to help