Cancelling Window 7 shutdown disables power button

12

Normally, pressing the power button once initiates a shut-down in Windows 7.

If any programs are still running that will not quit (e.g. waiting for a dialogue response), Windows overlays the screen with a dialogue allowing the user to cancel the shut-down.

I've just noticed that on two different systems here, using this cancel option disables the shut-down via power button. The power button can still be used to kill the system by holding it for a few seconds, using the Start menu button to shut the PC down still works as well.

Steps to reproduce:

  1. Open Notepad, type a few characters. Do not save.
  2. Press the computer's power button.
  3. Wait until the dark screen appears.
  4. Press cancel.
  5. Press the power button again. Notice how nothing happens.

What is the reason for this behaviour, and can it be disabled to always try and shut down the PC when the power button is pressed?

Jens

Posted 2012-06-08T16:01:50.850

Reputation: 629

1Do you want to not show that screen which appear to ask Force Shutdown and Cancel or just you want to use the power button to shut it down again? – avirk – 2012-06-08T16:53:18.557

Are the systems the same make and model? – Ramhound – 2012-06-08T17:21:26.787

2@Avrik: I'd like the power button to be able to shut the system down again. – Jens – 2012-06-08T19:48:46.800

@Ramhound: No, not at all. I don't have their hardware specs here at the moment, but one system was a recent core i3 system, while the other was a rather aged Pentium based system. – Jens – 2012-06-08T19:49:47.953

Answers

14

This is a known issue: http://support.microsoft.com/kb/2719667/en-us?sd=rss&spid=14498 (funny enough I just happened to see it show up recently in the knowledge base RSS feed)

If an application is preventing Windows from shutting down (ex. unsaved work), Windows will wait a period of 60 seconds at the force shut down dialog before forcing the application to close so shut down can continue. If the user cancels out of the force shutdown dialog, Windows still retains the 60 second timeout value. As a result, the next time a shut down occurs, even if there are no blocking applications, shut down will be delayed until the timeout value expires.

This behavior only occurs when configuring the power button to shut down the machine. When shutting down Windows through the Start Menu, the problem does not occur as the timeout value is not retained when cancelling out of the forced shutdown dialog.

Unfortunately the work-around is:

To work around this issue, use the shut down option from the Windows Start Menu instead.

Mark Sowul

Posted 2012-06-08T16:01:50.850

Reputation: 2 877

Shouldn't waiting a minute before pressing the button again also work? – Synetech – 2012-06-12T18:45:13.210

Thanks for your answer! The link to the knowledge base article is quite helpful. – Jens – 2012-06-13T09:10:09.293

7

I managed to reproduce this behavior on my HP DV7 (with and without SP1). Everything happened exactly as you said, until the computer suddenly shut itself down.

Further investigation showed that canceling the shutdown doesn't disable the power button. It just gets delayed.

Example of how the delay operates

  1. Open Notepad, type in a few characters. Do not save.

  2. Press the computer's power button.

  3. Wait until the dark screen appears.

  4. Click Cancel.

  5. Try either of the following:

    • Press the power button immediately.

      Nothing will happen right away, but the computer will attempt to shut itself down exactly 90 seconds after pressing the power button for the first time.

    • Wait until 90 seconds have passed after pressing the power button for the first time.

      If you press the power button now, the computer will attempt to shut itself down immediately.

Rationale

Windows prevents the power button from attempting to shut the computer down more than once in 90 seconds. I can only take an educated guess here, but I suppose this is to prevent multiple shutdown attempts due to a malfunctioning power button or pressing it accidentally.

[C]an it be disabled to always try and shut down the PC when the power button is pressed?

I couldn't find any documentation regarding this behavior, let alone a way to modify it.

But to shut the computer down after a failed attempt, just close the application preventing the shutdown and do either of the following:

  • Press the power button again. The computer will shut itself down automatically.

  • Click Start -> Shut down. There's no delay if you do it this way.

Dennis

Posted 2012-06-08T16:01:50.850

Reputation: 42 934

1

Hmm, the KB article that Mark linked to indicates the timeout is 60 seconds, not 90.

– Synetech – 2012-06-12T18:46:25.987

I timed it twice. It was exactly 90 seconds. – Dennis – 2012-06-12T19:22:15.413

I wonder if there is a setting that affects this, like WaitToKillAppTimeout on XP (I cannot find conclusive evidence of whether or not this one actually works in Windows 7. If not, then maybe it's because it is hard-coded or stored elsewhere in relation to KB2719667; which then would beg the question why yours differs from the KB article). – Synetech – 2012-06-12T19:30:55.477

I timed it again, just to be sure: It's 90 seconds after pressing the power button for the first time, not 60 seconds after the "force shutdown" dialogue appears. – Dennis – 2012-06-12T22:26:52.533

Yes, but why? Is it configurable? – Synetech – 2012-06-13T01:01:15.033

It's a laptop, so there's always the possibility that HP tampered with some settings in obscure ways. But if it was configurable, we could just set it to 0, which would contradict the KB article. Did you time it on your computer? There's always the possibility that the KB article is wrong. – Dennis – 2012-06-13T01:48:13.527

1

When you press the power button, Windows starts a shutdown transition and starts closing all the User Session applications ( the system is then in a shutdown_in_progress state ) but when some work needs to be saved first, the transition is then pending until that application is properly closed.

enter image description here

Starting another shutdown sequence will be discarded since there is an ongoing one, if you save that file you'll see that the shutdown transition will then continue by itself.

user8228

Posted 2012-06-08T16:01:50.850

Reputation: