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.
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.