How do I force shutdown, and automatically bypass all dialog windows?

Discussion in 'macOS' started by Gary King, Feb 18, 2006.

  1. Gary King macrumors 6502

    Joined:
    Jun 14, 2004
    #1
    For instance, when I shutdown, sometimes I get the dialog telling me that an app has not quit yet, and can't quit. So I need to click 'ok' on the dialog and re-shutdown.

    How do I make OS X automatically just hit 'ok' for those dialogs, and then shutdown? Like, bypass them, without requiring me to explicitly close them.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Assuming you are an Administrator on the machine open Terminal and type:

    sudo -u root shutdown -h now

    You will be asked for your admin password.

    The machine will now halt with no dialogs or warnings.

    Be VERY CAREFUL you will not even get prompted to save any unsaved work. Your apps just get killed. If you want to restart not halt substitute -r for -h.
     
  3. domenicop macrumors member

    Joined:
    May 16, 2013
    #3
    According to sudo documentation
    So why bother putting the -u root option?

    PS.I know it's a really old thread but as I found this, others will. :)
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Belt and braces: you never know if the default behavior will change (ok in this case I suppose it's very unlikely!). Also if you have a lot of code to maintain then it's much easier to have the exact option right there in the code to look at when you come back years later.
     
  5. Fishrrman macrumors 604

    Joined:
    Feb 20, 2009
    #5
    The easiest way to force a shut down the computer is to press the power-on key and KEEP HOLDING IT DOWN for about 4-5 seconds.

    The Mac will power off -- no prompts, no nuthin'.
    Just…. off.
     
  6. HenryAZ macrumors 6502

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #6
    Control-Option-Command-Eject all together will do a shutdown with no dialog.

    Control-Command-Eject will do a reboot the same way.
     
  7. canistel macrumors newbie

    Joined:
    Apr 24, 2013
    #7
    You forgot to mention... "Just disk corruption".

    This advice is horrible, please don't repeat that anywhere.
     
  8. Fishrrman macrumors 604

    Joined:
    Feb 20, 2009
    #8
    "You forgot to mention... "Just disk corruption".
    This advice is horrible, please don't repeat that anywhere."

    Your post is nonsense.

    The original question was -- how do you FORCE a shutdown, and bypass all dialog windows? That is, when NOTHING ELSE works.

    I gave the answer.

    Over many years of Mac usage (perhaps longer than you've been alive), I've done this numerous times when no other option seemed possible -- in most cases, the Mac "comes right back up", no problems at all.

    How many times have you had a power outage? Does the Mac boot back up?
    That's as "forced a shutdown" as one can have. I seem to recall at least a few instances when even the power button didn't appear to work, and I had to reach down and switch off the power strip.

    That's one of the strengths of OS X -- that is, its ability to "restore itself" from situations like that.
     

Share This Page