16

I had to power cycle my Macbook Pro by holding down the power button after it locked up.

When it restarted, it reloaded all the apps that I had been running before, which took a long time and was completely unnecessary.

Is there a way I can prevent it from reloading the previously running apps?

I'm running OS X 10.7.

4 Answers 4

9

Holding the shift key down at login should prevent apps from relaunching for that login.

If you want to permanently prevent apps from reopening, you can quit all apps then lock the com.apple.loginwindow.*.plist file found in ~/Library/Preferences/ByHost/

This plist keeps a list of open apps, and any apps that are in that list at logout will be launched again after login (assuming the checkbox is ticked to do so, as it always is by default). If you quit all apps, then lock that plist, it's list of apps will always be empty, so even when that checkbox is ticked, there will be no apps in the list to relaunch.

Unlocking the plist will return it to normal behavior.

2
  • Apart from Terminal — You need to have Terminal open to lock the file. But just having Terminal open is still a huge improvement.
    – Martin
    Commented Feb 2, 2017 at 7:57
  • 2
    How do you lock the file?
    – Zorgoth
    Commented Aug 16, 2019 at 18:11
9

What you are looking for is to disable ApplePersistence feature, which can be done with:

defaults write -g ApplePersistence -bool no
6
  • Note that this will disable Versions as well.
    – Brady
    Commented Apr 8, 2017 at 15:03
  • 4
    @Brady what are 'Versions'? what impact should I expect if I use defaults write -g ApplePersistence -bool no?
    – olyv
    Commented Apr 11, 2018 at 6:53
  • 1
    @olyv Versions in the file system. See here: apple.stackexchange.com/questions/27544/…
    – Brady
    Commented Jun 12, 2018 at 21:58
  • @Brady thanks, I get it now. And this is a link to Apple docs support.apple.com/en-ie/HT202255
    – olyv
    Commented Jun 13, 2018 at 8:01
  • The Apple support article link is now dead.
    – 2540625
    Commented Dec 21, 2021 at 16:15
4

First close all applications (this is important). Then in a terminal do:

sudo chown root ~/Library/Preferences/ByHost/com.apple.loginwindow*
sudo chmod 000 ~/Library/Preferences/ByHost/com.apple.loginwindow*

Basically, you need to make the loginWindow* files unwritable by anyone.

To undo:

sudo rm -f ~/Library/Preferences/ByHost/com.apple.loginwindow*
2
  • 1
    best solution here Commented May 31, 2022 at 12:45
  • Isn't a Terminal an application? (☞ ͡° ͜ʖ ͡°)☞
    – Sandwich
    Commented Aug 22, 2023 at 23:15
1

Go to System Preferences/General.

Un-click the box "Restore windows when quitting..."

1
  • 1
    That'll prevent an app from reopening windows when it starts, but it's completely separate from the feature that reopens apps at login. Commented Sep 21, 2011 at 16:01

You must log in to answer this question.

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