While Apple’s latest MacBook Pro models default to powering on when the notebook’s lid is opened or when the laptop is connected to power, some users may not appreciate the device booting up when opening the lid. Fortunately, it takes just a one line entry at the command prompt in Terminal to turn the feature off.
Open the Terminal app, which is found in /Applications/Utilities/, (or simply type in “Terminal” in Spotlight Search), and enter the following command syntax exactly as shown below:
sudo nvram AutoBoot=%00
Exit the Terminal app.
Now, when you open the MacBook’s lid, it will no longer automatically boot up the computer, or turn it on when the lid is opened.
If you decide to go back to the default setting of automatically powering on or booting up the MacBook Pro when opening the lid, start the Terminal application again, and enter the following at the command prompt. (Again, make sure you have typed the line exactly as seen below before pressing the Return Key.)
sudo nvram AutoBoot=%03
Hit return and close the Terminal app, and the MacBook Pro will return to its default “Auto On” setting.
You can also reset the MacBook Pro’s NVRAM to return the Mac to its original setting.
(Via OSXDaily)