Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Any way to complete turn off Reopening Windows on Login/Reboot???!!

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,


George.

MacBook Pro, Mac OS X (10.7.1), 15-inch, Core i7, Mid-2010

Posted on Aug 31, 2011 3:03 AM

Reply
15 replies

Aug 31, 2011 8:34 AM in response to George Botley

You may find this link interesting:


http://forums.macrumors.com/archive/index.php/.../t-1191622.html


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


"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 com.apple.loginwindow 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 (http://www.gizmoblurb.com/count/CleanShutDown/csd.php) for free.


Let me know if it works for you!


Victor Andreoni


source: GizmoBlurb (http://www.gizmoblurb.com)"



Sep 2, 2011 11:09 AM in response to George Botley

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 http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh

To Enable The Checkbox:
sudo defaults delete com.apple.loginwindow LoginHook

Sep 2, 2011 12:29 PM in response to Hugo Gernsback

Hugo Gernsback wrote:


On terminal, you need to run the following command:


defaults write com.apple.loginwindow 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:

/Users/yourUsername/Library/Preferences/ByHost/com.apple.loginwindow.*.plist

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/com.apple.loginwindow.*.plist"

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

Nov 20, 2011 11:52 AM in response to George Botley

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: http://osxdaily.com/2011/08/25/disable-reopen-windows-when-logging-back-in-in-ma c-os-x-lion-completely/


Meat of the article reproduced here:


Paste the following into a single line within the Terminal:

curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh

(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:

#!/bin/bash
echo "#!/bin/bash" > /tmp/loginfix.sh
echo "rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*" >> /tmp/loginfix.sh
mv /tmp/loginfix.sh /usr/bin/loginfix.sh
chmod +x /usr/bin/loginfix.sh
defaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh

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 com.apple.loginwindow LoginHook

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

Nov 20, 2011 12:02 PM in response to George Botley

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:


User uploaded file


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.

Jan 1, 2012 8:58 AM in response to babowa

Babowa:

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


User uploaded file

Jan 1, 2012 9:11 AM in response to Courtlandmcdonald

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......

Any way to complete turn off Reopening Windows on Login/Reboot???!!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.