Implement a Shutdown Confirmation?

10

3

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

Jeremy

Posted 2016-05-11T11:18:15.880

Reputation: 336

If such a feature exists, it can most likely be found in the power settings in the control panel. – a CVn – 2016-05-11T11:27:34.850

I cannot find it. Are there alternative solutions? – Jeremy – 2016-05-11T12:00:14.897

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. – a CVn – 2016-05-11T12:02:46.017

I guess the solution will apply to all modern Windows(7, 8, 10) OSes. – Jeremy – 2016-05-11T12:05:17.017

Did you use google? there are tons of entries for your problem. I guess this should work, please try it: http://winaero.com/blog/how-to-set-the-default-action-for-the-shutdown-dialog-in-windows-10/

– SimonS – 2016-05-11T12:16:30.730

@SimonS Yes I did. I've seen that post but it has nothing to do with my question. – Jeremy – 2016-05-11T12:18:47.247

1

@Jeremy how about the answer with 6 upvotes in this thread (even though it's windows 7?) http://superuser.com/questions/89957/how-to-force-a-confirm-shutdown-in-windows-7

– SimonS – 2016-05-11T12:26:52.090

1Disable the keyboard button. – Ƭᴇcʜιᴇ007 – 2016-05-11T12:30:09.533

@SimonS All I want is a simple confirmation dialog with yes/no buttons. – Jeremy – 2016-05-11T12:32:06.753

@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. – SimonS – 2016-05-11T12:37:08.903

@Ƭᴇcʜιᴇ007 How? – Jeremy – 2016-05-11T12:58:07.187

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.

– Ƭᴇcʜιᴇ007 – 2016-05-11T13:01:04.803

@Ƭᴇcʜιᴇ007 Ah. What I actually mean is the buttons on screen. http://i.imgur.com/2Iph8RQ.png

– Jeremy – 2016-05-11T13:04:47.757

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 ;) ). – Ƭᴇcʜιᴇ007 – 2016-05-11T13:06:24.877

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 – 2016-05-11T15:55:46.250

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. – ths – 2016-05-11T15:59:07.750

@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. – Jeremy – 2016-05-11T16:00:00.450

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. – Chris Peacock – 2018-11-09T12:57:56.180

Answers

7

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

Nassbirne

Posted 2016-05-11T11:18:15.880

Reputation: 1 049

This is same as SimonS' answer in comment. I don't want to choose a reason every time I shutdown my computer. – Jeremy – 2016-05-11T15:46:10.887

2Well you can just click "Continue" without changing the default reason. – Nassbirne – 2016-05-11T15:49:16.593

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 – 2016-05-11T15:54:17.877

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 – 2016-05-11T17:00:18.807

1This does exactly what you asked for: Confirmation on shutdown. You don't even have to select a reason from the reason box. – Bort – 2016-05-11T20:45:05.660

@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 – 2019-08-10T19:07:12.390

The option Local Computer Policy > Computer Configuration > Administrative Templates > System > Display Shutdown Event Tracker isn't available on Windows 10 Pro v1809 – xtian – 2019-08-10T19:19:53.790

0

Create the following batch file and use instead.

@ECHO OFF

:choice
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


:yesplease

shutdown /s /t 10
exit

:nothanks
exit

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

Narzard

Posted 2016-05-11T11:18:15.880

Reputation: 2 276

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 – 2016-05-11T13:41:23.877

Why would you pause before exiting? Why have the exit statements? The script would close anyways – Canadian Luke – 2016-05-11T14:56:59.553

@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 – 2016-05-11T15:22:30.500

@Jeremy I cannot find any information on editing the button for anything custom. Only making it perform different built-in functions. – Narzard – 2016-05-11T15:23:38.097

@Narzard ahh.. I hope Windows will implement this feature. – Jeremy – 2016-05-11T15:26:14.603