I have to restart my Mac all the time because I'm using Boot Camp and switching in between Windows 8 and OS X. Every time I restart and come back to OS X, my screen gets flooded with open windows, every thing from Firefox to text editors. Is there any way to set it up so that there are no open windows upon restart?
Disable Resume on login permanently
What you are experiencing are the benefits of working with Resume. A feature introduced with Mac OS X Lion to restore windows upon next launch or login.
Unchecking the box does not have a permanent effect. This can be achieved by manual tweaking.
Open the Terminal and enter:
curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && md5 -q ~/fixlogin.sh | xargs -I % mv ~/fixlogin.sh ~/%.sh && chmod +x ~/121dca51e66073624da420b6e1be61d9.sh && sudo ~/121dca51e66073624da420b6e1be61d9.sh ; rm ~/121dca51e66073624da420b6e1be61d9.sh
This command downloads the following script and fully installs it:
#!/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
Et voilà, you are done!
If you want to revert to the default behavior of Resume in lion, type this.
sudo defaults delete com.apple.loginwindow LoginHook
Disable Resume when launching apps
You can also disable Resume for applications on a per app basis. See these answers here.
You have two choices. You can choose that your applications not resume their previous state when you shutdown or restart the Mac by deselecting the checkbox that appears prior to shutdown:
Or you can navigate to the General pane in System Preferences and deselect the Restore windows when quitting and re-opening apps option. However, if you do this, applications will never resume their previous state, even when quit and restarted during a single boot session.