One of the most annoying features in OS X Lion for me has been the little checkbox on the shutdown dialog box that states, “Reopen windows when logging back in.” Going through the trouble of managing this checkbox every time I shut down is a hassle I’d rather not go through. Fortunately, there is a neat little Terminal trick that will allow you to render this button useless, as I’ll show you in the video below.
To Disable The Checkbox:
curl https://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

52 responses to “Disable Lion’s Resume Checkbox When Shutting Down [Video How-To]”
How did you make your terminal look like that?
I am also running OS X Lion and mine looks plain white.
Finder resumed even in Snow Leopard.
look under file- new window. It’s silver aerogel.
dam that was a fast start up. did you video edit that or was that your actual start up time. because i want my mac to start up like that *snaps*
Or you can hit the spacebar to uncheck.
With OSX’s sleep function being so polished and useful, I don’t even need to shutdown my MPB as the most I have gone without using it has been only a couple of hours… while I sleep :)
You can also customize terminal windows any way you want
If it doesn’t bother you that:
1) Logoff is one more action away
2) Missing the action can cost you dearly on your next login
You’re in the minority
Thanks a lot for this, I started looking for a way to disable this from day one. Great work
great video. what program are you using to record screen capture. I like it alot.
How did you get those boxes for your applications and document folders in the dock?
It makes me paranoid running a command line function that points to a URL… which contains a script (.sh) file! Did anyone miss that? Be REALLY careful what you execute at the command line!
totally…
From here:
http://t.ecksdee.org/post/1900…
From here:
http://t.ecksdee.org/post/1900…
ya i agree…. i dont trust it, why cant we just have the cmd code
In the interest of transparency here’s the script.
#!/bin/bashecho “#!/bin/bash” > /tmp/loginfix.shecho “rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*” >> /tmp/loginfix.shmv /tmp/loginfix.sh /usr/bin/loginfix.shchmod +x /usr/bin/loginfix.shdefaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh
just go to that link, it’ll give you the script. i’ve copied it here.
#!/bin/bashecho “#!/bin/bash” > /tmp/loginfix.shecho “rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*” >> /tmp/loginfix.shmv /tmp/loginfix.sh /usr/bin/loginfix.shchmod +x /usr/bin/loginfix.shdefaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh
Here’s the contents of the downloaded script:
#!/bin/bashecho “#!/bin/bash” > /tmp/loginfix.shecho “rm /Users/*/Library/Preferences/ByHost/com.apple.loginwindow.*” >> /tmp/loginfix.shmv /tmp/loginfix.sh /usr/bin/loginfix.shchmod +x /usr/bin/loginfix.shdefaults write com.apple.loginwindow LoginHook /usr/bin/loginfix.sh
I did a video on it a while back, look back and you should be able to find it.
Screenflow.
I cut the video to save time.
If you actually download the .sh file and open it in text edit you will see that it is doing as advertised and nothing more. No worries.
I still believe that having this option available is great. I would very much prefer an option to say box unchecked by default and be able to check for if I’m let’s say moving my mac for a demonstration where I want all my things on. (I don’t like moving my mac in the subway while it’s sleeping.)
If you don’t want to run the script, just hold down the option/alt key when you click “Shut Down.” This will do a shutdown as if you had unchecked the restore option. This way, you still have the option to restore windows if you so choose.
Thanks for the tip :)
@ Michael
Thank you for showing us how to stop this annoying feature
thanks man!