

So I've entered osascript -e 'tell application "System Events"' -e 'shut down' -e 'end tell' into a terminal window and pressed enter and it safely shutdown my system. If you need to reboot and you don't feel like shutting down your apps one by one or waiting for Mac OS to walk you through them, press Ctrl+Cmd+Eject to reboot your Mac immediately. If any applications have unsaved work, the shutdown would halt. I wonder if Topher could make one and share it here. 2.-Force Finder quit with a Script placed in the Desktop AND in the Dock for easier access (one of them may be blocked). Osascript -e 'tell application "System Events"' -e 'shut down' -e 'end tell' More methods to reboot or shutdown the Mac after failed reboot or shutdown from the Finder or when the USB ports get blocked: 1.-Force Finder quit with Option Command esc. It would be like selecting "Shutdown" from the Apple menu: If you want a more graceful method, I believe you could use AppleScript from the command line to send an apple event instead. On the Remote Shutdown Dialogue page, select Restart or Shutdown options. Click on Add to mention list of Server that you are planning to restart or shutdown remotely. Using cron, you could make simple jobs that first use pmset to schedule the next startup, then execute a shutdown.Īs hayne said, the 'shutdown' command will not give any GUI processes an opportunity to save files and whatnot. Type Shutdown /i on the command prompt and it will open another dialogue box. You can modify these settings from the command line using 'pmset'. And don’t worry, no harm can come to your machine by canceling the shut down process.Ok I found this note and what he offers works! (I found these commands on the website I linked to.) As you can imagine, when I issue the first command, the wireless icon in the Mac menubar shows that. and I use this command to turn the Mac wireless network service back on: sudo ifconfig en0 up.
Once the shut down has been cancelled, you can do whatever it is you needed to do, then shut down again when done. To shut down your Mac, type the following command: sudo shutdown -h