1

I want to use command line to restart my mac OSX, I'm using:

sudo shutdown -r now

But i want to restart without the reopen windows option, I've looked at the documentation here but with no luck, Any idea?

2
2

Here's a script that will disable the feature completely on a constant basis, regardless of whether that checkbox to preserve windows is checked or not, the windows will not restore.

#!/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

To restore default behavior:

sudo defaults delete com.apple.loginwindow LoginHook

Full details here:

http://osxdaily.com/2011/08/25/disable-reopen-windows-when-logging-back-in-in-mac-os-x-lion-completely/

You may also be interested in this:

http://osxdaily.com/2011/07/18/disable-mac-os-x-lion-resume-window-restore/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.