Implement a Shutdown Confirmation?

15,607

One way to get a confirmation dialog upon hitting the shutdown button is to enable Shutdown Event Tracker:

Configure Shutdown Event Tracker on the Local Computer

Since the link above is not up-to-date for Windows 10, the following are step-by-step instructions for Windows 10 (verified with version 21H1):

  • Start gpedit.msc
  • In the Local Computer Policy navigation pane, expand Computer Configuration, expand Administrative Templates, and click All Settings
  • In the console pane, scroll down to the list of objects and double-click Display Shutdown Event Tracker
  • Click Enabled
  • Verify that in Options, Shutdown Event Tracker should be displayed: is set to Always
  • Click OK

You will have to select a reason for the shutdown, like so:

enter image description here

Share:
15,607

Related videos on Youtube

Jeremy
Author by

Jeremy

Updated on September 18, 2022

Comments

  • Jeremy
    Jeremy almost 2 years

    How do I configure Windows 10 so that it displays a confirmation dialog every time I press the Shut down button?

    Sometimes I would shutdown my computer accidentally, as the sleep button is just above shutdown button, and lose my unsaved work:

    enter image description here

    • user
      user about 8 years
      If such a feature exists, it can most likely be found in the power settings in the control panel.
    • Jeremy
      Jeremy about 8 years
      I cannot find it. Are there alternative solutions?
    • user
      user about 8 years
      I don't have any Windows 10 system handy, which is why I only left a comment that I hoped would be helpful. (Seems it wasn't, but that's how it goes at times. Can't be right every time.) Unless I stumble across something helpful, I'll leave actually answering this to others.
    • Jeremy
      Jeremy about 8 years
      I guess the solution will apply to all modern Windows(7, 8, 10) OSes.
    • SimonS
      SimonS about 8 years
      Did you use google? there are tons of entries for your problem. I guess this should work, please try it: winaero.com/blog/…
    • Jeremy
      Jeremy about 8 years
      @SimonS Yes I did. I've seen that post but it has nothing to do with my question.
    • SimonS
      SimonS about 8 years
      @Jeremy how about the answer with 6 upvotes in this thread (even though it's windows 7?) superuser.com/questions/89957/…
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 about 8 years
      Disable the keyboard button.
    • Jeremy
      Jeremy about 8 years
      @SimonS All I want is a simple confirmation dialog with yes/no buttons.
    • SimonS
      SimonS about 8 years
      @Jeremy And all I want is love, seems like we're both not getting what we want :-). No seriously, seems like Microsoft removed this option. I guess you'll have to live with a workaround as I posted in my last comment.
    • Jeremy
      Jeremy about 8 years
      @Ƭᴇcʜιᴇ007 How?
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 about 8 years
      There's plenty of info out there on ways to do it. IE: Disable shutdown key on my keyboard?, Disabling Power button on keyboard, etc.
    • Jeremy
      Jeremy about 8 years
      @Ƭᴇcʜιᴇ007 Ah. What I actually mean is the buttons on screen. i.imgur.com/2Iph8RQ.png
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 about 8 years
      Ahh gotcha! When you said you were accidentally hitting the power button because it was right above the sleep button, I thought you were talking about a physical keyboard button (as that's come up lots in the past ;) ).
    • ths
      ths about 8 years
      wait, does that mean that win 10 doesn't have a default shutdown button action anymore, like win 7? and then they put the options so close you have trouble selecting one? that's... i don't even.
    • ths
      ths about 8 years
      do they at least offer keyboard shortcuts? we can't see them anymore of course, since, in their infinite wisdom, they decided not to show the underlined characters anymore per default.
    • Jeremy
      Jeremy about 8 years
      @ths As you can see from the image in my post. I don't have problem selecting those buttons but, when I'm in a rush I may click the wrong button.
    • Chris Peacock
      Chris Peacock over 5 years
      I can't believe this was removed from Windows. It's one of the things that really infuriates me about it, along with Windows automatically restarting itself to appy updates with no warning, when left for a period. It's far too easy, as the OP says, to accidentally press the Shutdown button; there's no way to cancel the shutdown, neither does it seem to allow running applications (e.g. with unsaved documents) to halt the shutdown, as it used to.
  • Jeremy
    Jeremy about 8 years
    I'm not asking how to code the confirmation dialog. It'd be nice if the bat file can be ran when I click the shutdown button.
  • Canadian Luke
    Canadian Luke about 8 years
    Why would you pause before exiting? Why have the exit statements? The script would close anyways
  • Narzard
    Narzard about 8 years
    @CanadianLuke you're right, it was a copy paste from something else i had and I didn't remove them. I have edited to reflect the correct script.
  • Narzard
    Narzard about 8 years
    @Jeremy I cannot find any information on editing the button for anything custom. Only making it perform different built-in functions.
  • Jeremy
    Jeremy about 8 years
    @Narzard ahh.. I hope Windows will implement this feature.
  • Jeremy
    Jeremy about 8 years
    This is same as SimonS' answer in comment. I don't want to choose a reason every time I shutdown my computer.
  • Nassbirne
    Nassbirne about 8 years
    Well you can just click "Continue" without changing the default reason.
  • Jeremy
    Jeremy about 8 years
    I am looking for a better sulution. If there is none, I'll accept your answer. Btw, what are the uses to provide a reason before shutting down?
  • Nassbirne
    Nassbirne about 8 years
    This is mainly a feature of the server versions of Windows which have it enabled by default. It generates entries in the event log which can be useful for system administrators.
  • Bort
    Bort about 8 years
    This does exactly what you asked for: Confirmation on shutdown. You don't even have to select a reason from the reason box.
  • xtian
    xtian almost 5 years
    @Jeremy, I want to use confirmation to avoid acidentally shutting down my work system after telecommuting from home--also using Windows 10. In two years of telecommuting, I've just done this for the first time yesterday, and on Friday there was no one left to turn it back on.
  • xtian
    xtian almost 5 years
    The option Local Computer Policy > Computer Configuration > Administrative Templates > System > Display Shutdown Event Tracker isn't available on Windows 10 Pro v1809
  • Tydaeus
    Tydaeus over 3 years
    @xtian and others noticing the option isn't available: mine was semi-hidden. gpedit.msc > Local Computer Policy > Computer Configuration > Administrative Templates > All Settings > Display Shutdown Event Tracker worked for me.