How can I shut down my Mac via Terminal or AppleScript, but without restoring?
tell application "Finder" to sleep
works not, the windows will be restored.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
To prevent application windows from being restored, paste the following into a single line within the Terminal:
"curl http://goo.gl/Z4EFC -L -s -o ~/fixlogin.sh && chmod +x ~/fixlogin.sh && sudo ~/fixlogin.sh ; rm ~/fixlogin.sh"
For more info on the above script, look here
Now, in terminal, type "shutdown -h now" to shutdown or "shutdown -r now" to restart.