ANNOYING FEATURE: Reopen Windows When Logging Back In
iMac, Mac OS X (10.7.2)
Read this discussion
This link has more info. Sorry for confusion https://discussions.apple.com/thread/3202933?answerId=15854503022#15854503022
Message was edited by: b j t
Yes, it is "curable". There is a simple solution using the Terminal app in your Utilities folder. Once done successfully, that box will remain checked, but the prior windows will not open.
Apple needs to make this REOPEN a System Preference, but this is just one of many improvements needed in this OS.
Turning Off “Reopen windows when logging back in” by Making it Useless
Remember, this script disables the feature, but the dialog window will still pop up. The difference is with this script, it won’t matter if the dialog box is checked or not, windows and apps will not restore.
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.
ANNOYING FEATURE: Reopen Windows When Logging Back In