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?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
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:
You may also be interested in this: