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

  • If such a feature exists, it can most likely be found in the power settings in the control panel. – user May 11 '16 at 11:27
  • I cannot find it. Are there alternative solutions? – Jeremy May 11 '16 at 12:00
  • 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. – user May 11 '16 at 12:02
  • 1
    @Jeremy how about the answer with 6 upvotes in this thread (even though it's windows 7?) superuser.com/questions/89957/… – SimonS May 11 '16 at 12:26
  • 1
    Disable the keyboard button. – Ƭᴇcʜιᴇ007 May 11 '16 at 12:30

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

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

enter image description here

| improve this answer | |
  • This is same as SimonS' answer in comment. I don't want to choose a reason every time I shutdown my computer. – Jeremy May 11 '16 at 15:46
  • 2
    Well you can just click "Continue" without changing the default reason. – Nassbirne May 11 '16 at 15:49
  • 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? – Jeremy May 11 '16 at 15:54
  • 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. – Nassbirne May 11 '16 at 17:00
  • 1
    This does exactly what you asked for: Confirmation on shutdown. You don't even have to select a reason from the reason box. – Bort May 11 '16 at 20:45

Create the following batch file and use instead.


set /P c=Are you sure you want to shutdown[Y/N]?
if /I "%c%" EQU "Y" goto :yesplease
if /I "%c%" EQU "N" goto :nothanks
goto :choice


shutdown /s /t 10


Paste this text into notepad, and save it as "shutdown.bat" (include the quotations.) The quotes force it to save as a .bat file.

edit: removed unecessary pause statements

| improve this answer | |
  • 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. – Jeremy May 11 '16 at 13:41
  • Why would you pause before exiting? Why have the exit statements? The script would close anyways – Canadian Luke May 11 '16 at 14:56
  • @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 May 11 '16 at 15:22
  • @Jeremy I cannot find any information on editing the button for anything custom. Only making it perform different built-in functions. – Narzard May 11 '16 at 15:23
  • @Narzard ahh.. I hope Windows will implement this feature. – Jeremy May 11 '16 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.