Articles October 6, 2011 at 9:24 am

Disable ‘reopen windows when logging back in’ option in Lion

You can use the following command to disable the 'reopen windows when logging back in' option in Lion:

<code>defaults write LoginwindowLaunchesRelaunchApps -bool false</code>


  • Can’t say I’m able to get this to work. The tick box for this option is still selected when I choose restart or shutdown from the Apple menu.

    • So it does look like this works although the tick box remains ticked (10.7.1/11B26). Restarted my Mac and NO apps auto-opened. I would have thought that the tick box would be un-ticked if LoginwindowLaunchesRelaunchApps = 0.

      Just to confirm….”defaults read LoginwindowLaunchesRelaunchApps” = 0

      Thanks for the hint. Been looking for something like this.


  • To permanently disable ‘Reopen windows when logging back in,’ you can use the following command:

    defaults write TALLogoutSavesState -bool false

    This will effectively disable ‘Reopen windows when logging back in,’ though the checkbox will still be ticked. However, this switch resets itself every time on reboot. To prevent this from happening, again we remove write permissions on the file containing the option:

    chmod a-w ~/Library/Preferences/

    This should do it. But there’s where OS X gets nasty. When it can’t write to this file, it will try to put the write permissions back itself. The solution is to change the owner to root, effectively preventing anyone (but root) from changing permissions on the file:

    sudo chown root ~/Library/Preferences/

    To reverse this, simply issue the following commands:

    sudo chown $USER ~/Library/Preferences/
    chmod a+w ~/Library/Preferences/
    defaults write TALLogoutSavesState -bool true

    • BTW, I think that came from I copy things into a database and I want to give credit where it’s due…

Leave a reply

You must be logged in to post a comment.