How to cancel a restart in Mac OS X 10.6

23,461

Solution 1

if you're really quick you could open a terminal window and type

sudo killall shutdown

that might work. Otherwise, quickly open an application that always asks if you really want to quit. You could use applescript to make such an application:

on quit
display dialog "Really shut down?" buttons {"No", "Yes"} default button "no"
 if the button returned of the result is "Yes" then
 continue quit
 end if
 -- If I don't continue the quit, the app will keep running.
end quit

type that into the applescript editor and save it as an application, then put it somewhere handy.

NB. Both of these methods may not work. I'm too lazy to find out if they do, because it might involve having to reboot several times.

Solution 2

Quickly go click an icon in the dock to launch an app that wasn't running.

That's what I do if I can't use the unsaved documents trick.

Solution 3

I always keep a random string unsaved in TextEditor, then before rebooting I'll be asked if I wanna save the document, and it gives me time to think if I really want a reboot. By hitting Cancel on the dialog, the reboot will be cancelled.

It's a dirty trick, but works well for me.

Solution 4

Unfortunately I don't know of any shortcut-based command that stops the restarting, but there are some... Unusual ways to cancel the restart.

As you said, having an open unsaved document allows you to halt the restart.

Having a web browser with browsers open (Firefox is the best option) which would warn you and prompts if you want to save the tabs for the next browsing session has the same effect.

Share:
23,461

Related videos on Youtube

Ritwik Bose
Author by

Ritwik Bose

PhD student

Updated on September 17, 2022

Comments

  • Ritwik Bose
    Ritwik Bose almost 2 years

    When I hit restart, after a second or two, everything closes and the machine restarts. But sometimes, within that second I realize that I really didn't want restart just then. How can I stop the machine from restarting at that time?

    The best way I can figure out is to cancel a save request if something needs saving, but that isn't always the case.

  • stib
    stib almost 14 years
    according to the man page for shutdown on osx there's no -c option
  • Ritwik Bose
    Ritwik Bose almost 14 years
    and @JFW I like your suggestions, but it would be nice if I could have my shut down continue unhindered if I didn't do anything. At the moment, it seems that I would have to essentially confirm shutdown, which is not great (not as bad as shutting down just as my boss walks in requesting file X)
  • stib
    stib almost 14 years
    Well you could have the dialogue time out - add "with timeout 5" to the end of the "display dialog" line. That way you've got a 5 second window to click the "no" button. Anyway, if you just have the applescript's icon somewhere handy like the dock you can click it whenever you want to abort a shutdown, rather than run it every time.
  • Ritwik Bose
    Ritwik Bose almost 14 years
    I'll give it a shot when I get out of bootcamp.