Uncheck "Reopen windows when logging back in" by default The shutdown/restart dialog has a check-box Reopen windows when logging back in which is checked by default. I need to change its behavior to be unchecked by default. Is this possible? If yes, how can I do that?
Edit: since 10.7.4, the "Reopen windows when logging back in" checkbox has stayed unchecked if you uncheck it once, so the hacks below are not needed anymore.

One option is to set the LoginwindowLaunchesRelaunchApps key to false in ~/Library/Preferences/com.apple.loginwindow.plist:

defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false


You could also save this property list as ~/Library/LaunchAgents/logout_saves_state.plist:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;logout_saves_state&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;defaults&lt;/string&gt;
        &lt;string&gt;write&lt;/string&gt;
        &lt;string&gt;com.apple.loginwindow&lt;/string&gt;
        &lt;string&gt;TALLogoutSavesState&lt;/string&gt;
        &lt;string&gt;-bool&lt;/string&gt;
        &lt;string&gt;false&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Then load the property list by running launchctl load ~/Library/LaunchAgents/logout_saves_state.plist or by logging out and back in once.

TALLogoutSavesState sometimes got reset to true when I logged out and back in, so just running defaults write com.apple.loginwindow TALLogoutSavesState -bool false once wouldn't have worked.

Neither of these options actually makes the checkbox appear unchecked, but they have the same effect.