Previous 1 2 Next 15 Replies Latest reply: Oct 25, 2013 5:26 AM by David Glasgow
George Botley Level 1 Level 1 (20 points)

Hello Guys,


I have been a Mac user for around 4 years now and can't fault them.


But as of recently, with the introduction of Lion, my opinions are begining to change....


Mac OS X 10.7.1 introduced many new features, many helping, but one in particular that is winding me up the wall is Window Restore.


I have turned it off within System Preferences but whenever I restart my Mac or logoff and logon again all the Windows I had open re-open... making a boot time of less than 30 seconds increase - which is not helpful when working with large client workflows in a tight deadlined business environment.


I'm sure many of you will agree with this annoyance, but can any of you offer a hint as to how to prevent this feature entirely...


It is starting to make me want to downgrade to 10.6, which I don't really want to do as Lion brings increased performance in many areas.


Thanks for the help guys,



MacBook Pro, Mac OS X (10.7.1), 15-inch, Core i7, Mid-2010
  • Barry Hemphill Level 8 Level 8 (36,755 points)



    I have turned it off within System Preferences

    Did you do this in system preferences>general (uncheck the box "restore windows when quitting and reopening apps")?



  • George Botley Level 1 Level 1 (20 points)

    I have done this, but they still seem to come back up which is soo frustrating..

  • Barry Hemphill Level 8 Level 8 (36,755 points)



    Try trashing a preference file ( and restarting.  Then reenter your own preferences and see if that helps.


    FWIW, what I asked above worked for me - even after restarts.



  • francesfromet Level 1 Level 1 (0 points)

    Am having exactly the same problem, along with others unrelated (maddening!) and Tech Support cannot help. I have updated System Prefs but that doesn't stop the windows from opening on startup. Please give further details on trashing a preference file—where do I find it?

  • Barry Hemphill Level 8 Level 8 (36,755 points)

    The preference file is located in the home folder (~library>preferences).  To display the library folder from the Finder, click on the menu bar "go" while holding the option key down.



  • Hugo Gernsback Level 1 Level 1 (0 points)

    You may find this link interesting:



    you have to scroll down a bit to a user VicAnd7:




    Jul 26, 2011, 10:02 PM

    After digging around for a while, I found a way of dealing with this annoying feature.


    On terminal, you need to run the following command:


    defaults write TALLogoutSavesState 0


    This, despite the fact that the checkbox will still be marked, will kill every app when you turn off your Mac.


    The only catch is that you have to run the command each time that you're going to either reboot or shut down since the system automatically changes the value to "1" again.


    To sort this out, I created an AppleScript-based app that with just clicking its icon, it will run the command and shut your mac down for you.


    You can download it here ( for free.


    Let me know if it works for you!


    Victor Andreoni


    source: GizmoBlurb ("



  • SteveKir Level 3 Level 3 (545 points)

    I have squirreled this away and will give it a go in due course. Thanks to (Actually, I hardly ever shut down and restart my Mac.)

  • shakamar Level 1 Level 1 (0 points)

    To disable or enable it again open terminal and copy and paste one of the following depending on it you are enabling it or disabling it. The resme box will still show when you are restarting, but it will be disabled regardless if the box is checked or not.

    To Disable The Checkbox:
    curl -L -s -o ~/ && chmod +x ~/ && sudo ~/ ; rm ~/

    To Enable The Checkbox:
    sudo defaults delete LoginHook

  • shakamar Level 1 Level 1 (0 points)

    Forgot to say that after you paste it into terminal, hit enter.  It will then ask for your password.  Enter your password and hit enter.  Exit terminal. 

  • billearl Level 2 Level 2 (175 points)

    Hugo Gernsback wrote:


    On terminal, you need to run the following command:


    defaults write TALLogoutSavesState 0


    This, despite the fact that the checkbox will still be marked, will kill every app when you turn off your Mac.


    The only catch is that you have to run the command each time that you're going to either reboot or shut down since the system automatically changes the value to "1" again.

    Setting TALLogoutSavesState to "0" simply sets a flag to delete the plist file:


    at shutdown (where * is a string of 12 characters).


    I use an AppleScript which runs automatically at every restart/shutdown to do this directly:

    do shell script "rm -f ~/Library/Preferences/ByHost/*.plist"

    (replace * with the actual string of 12 characters).

  • Zacharias Beckman Level 1 Level 1 (100 points)

    Yea, this is the worst idea I've seen, especially with Lion's inherent instability issues. My regular workflow, which seems to take place at least once, sometimes three or more times a day:


    1. System starts to get boggy, and I notice a few apps (Finder usually the real kicker) stop responding.
    2. Attempt to reboot... baby sit, often have to force reboot.
    3. At login, as many as 10 apps restart, reload window configurations, and start doing exactly what it was that led to the system starting to bog down and freeze up...
    4. After waiting 1-3 minutes for login to finish, I quit all the apps that I don't need anymore.


    Godawful stupid idea... When did Apple start hiring all the Microsoft programmers, huh?


    Anyhow, I found this over on MacRumors, and it seems like a pretty decent way to prevent this idiotic behavior without being a "hack" per-se. Note this is the same reference posted above, but with more detail so you can read about it and understand better:


    Link: c-os-x-lion-completely/


    Meat of the article reproduced here:


    Paste the following into a single line within the Terminal:

    curl -L -s -o ~/ && chmod +x ~/ && sudo ~/ ; rm ~/

    (The above text is intentionally small so that it will fit on a single line)

    That command downloads a script, places it in the appropriate location, makes it executable, and then removes the temporary file. If you are wondering, the contents of the downloaded bash script are the following:

    echo "#!/bin/bash" > /tmp/
    echo "rm /Users/*/Library/Preferences/ByHost/*" >> /tmp/
    mv /tmp/ /usr/bin/
    chmod +x /usr/bin/
    defaults write LoginHook /usr/bin/

    If you ever want to revert back to the default behavior of this OS X Lion feature, just type the following defaults write command:

    sudo defaults delete LoginHook

    And you’ll be back to be able to select window restore based on that checkbox’s choice.

  • babowa Level 7 Level 7 (26,830 points)

    I have found this little trick which has worked for me since I invoked it back in August (without doing the terminal commands):


    Hold Option key while going to Go menu in menu bar to unhide User Library folder.

    Once in Library, scroll down to Saved Application State folder.

    Open folder and move everything to trash (this will disable ALL!!).

    Highlight folder icon and use Command key + I (Get info)

    Once window is open, scroll to bottom, unlock lock and enter your admin password.

    Scroll back up and check the "locked" option:


    Screen Shot 2011-11-20 at 11.59.33 AM.png


    Scroll back down and lock the lock.


    As you can see my folder contains zero bytes; since it is locked, no application can save anything to it. This is system wide though, so if you like some to open, don't use this method.

  • Courtlandmcdonald Level 1 Level 1 (0 points)


    This is a great work-around and so far I have not seen any problems with it.


    Another benefit I found with your work-around is with Xcode. I want the Xcode 'Welcome Screen' to launch by default ALWAYS! However, it always launches in the state it was in when I closed the application even though I checked the box at the bottom of the Xcode Welcome Screen that says "Show this window when Xcode Launches".


    So Xcode now works the way I believe it was intended to work. I love OS X Lion, I think it is a beautiful product and integrates with iOS  very well. Following that thought however, I am guessing that Lion was developed to mimic iOS in many ways. So maybe Apple just assumed that when you restart or cold start Lion OS X, you would want all your apps to reload from a suspended state just as they do on the iPhone/iPad.


    I see where they are coming from but, my preference would be to have the checkmark for "Reopen windows when loggin back in" removed by default, or at least include that option - maybe somewhere in System Prefs?


    So, thank you for this work-around. It is very much appreciated.   - Courtland



  • babowa Level 7 Level 7 (26,830 points)

    I'm glad to hear that worked for you! I'm not sure I share your enthusiasm regarding Lion: I don't want my 27" iMac to mimic an iPhone and I prefer having control over simple functions. I sent in a report requesting a System Preference Option to have an on/off switch (either system wide or by application) - obviously didn't meet their criteria of worthwhile suggestions......

Previous 1 2 Next