6

I'm trying to remove the "Sleep" and "Shutdown" entries from the Apple menu. So far I managed to do it by editing /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Versions/A/Resources/English.lproj/StandardMenus.nib/objects.xib but that solution is quite ugly. It can be a cause of some instabilities?

I tried the following commands:

sudo defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabled -bool true
sudo defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabledWhileLoggedIn -bool True

but they don't seem to work anymore (I used this in Mountain Lion). I wondered if there was any better way to do disable those entries.

2

Not sure about Shut Down but you can disable Sleep using pmset:

sudo pmset -a disablesleep 1

This will gray out the Sleep menu item as well.

Source: OS X Server: How to prevent sleep

  • This does not answer the OP's question. The question is how to remove the command from the Apple menu, not prevent the Mac from sleeping. - From Review - – fsb Aug 29 '16 at 21:00
  • 1
    As mentioned in the linked article, it grays out the Sleep menu item too.. :) – MacManager Aug 29 '16 at 21:29
  • Please add all the relevant information to your answers in order to make them more useful. Links may rot: en.wikipedia.org/wiki/Link_rot – Jaime Santa Cruz Aug 29 '16 at 21:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .