Home > Windows > How long do you need to hold down the power button to turn off a PC?

Raymond Chen published another story from the Windows development trenches, this time about what happens when you hold down the power button.

If you hold a PC’s power button for 12 seconds, it will turn off at the hardware level without notifying the operating system. This is a safety feature so that you can turn of the computer even if the operating system’s “Shut down” command isn’t working.

After eight seconds of the power button being held down, the Windows kernel realizes that the user is trying to do a force-power-off of the system, and it quickly takes a kernel dump that can be uploaded to the Windows Error Reporting service the next time you turn the system on.

↫ Raymond Chen

I’m a bit confused by these numbers, because I have never seen a PC take this long to power off when holding down the power button; usually it takes only a few seconds to do so, meaning Windows would never generate said kernel dump. I tried reading through the various ATX specification documents to find more information on this, but then I remembered I’m not an electrical engineer so I have no idea what I’m looking at.

The baseline is that ATX always provides standby power to the motherboard, and pressing the power button shorts the power button pin to ground, telling the PSU to power on fully. Pressing the power button if the computer is running tells the operating system to initiate a shutdown (although you can change this behaviour), but if you hold the button down for a certain number of seconds, it forces a power-off. So far, so good; basic information.

It seems that the length of time you need to hold down the power button to force a power-off is dependent on the motherboard in question, handled by a microcontroller or some other IC. Virtually every source I can find says this timing is set to about 4-5 seconds, which is quite a bit shorter than the number of seconds given by Chen. Perhaps motherboard manufacturers consider the 12 seconds to be too long, and just do their own thing, regardless what the ATX specification suggests?

What further complicates matters is that Chen details how the kernel dumps created after pressing the power button for 8 seconds do, in fact, get sent to Microsoft once the computer turns on again. In fact, he is one of the people who gets to see these dumps and respond to them, so obviously they are indeed rolling in. Does this mean there’s a huge number of computers out there that require you to hold down the power button for 12 seconds to force a shutdown that nobody’s ever seen?

These emergency kernel dumps are internally classified as “long power button hold” (LPBH) failures. One of the pieces of information recorded in these emergency kernel dumps is whether the screen consists entirely of black pixels. Those failures are sub-classified as “black screen LPBH”, and they go to a special virtual team for analysis. (I happen to be a member of this black screen LPBH team.)

↫ Raymond Chen

What’s going on here? Obviously, I’m not going to doubt Chen, so there must be something here I don’t quite understand or that I’m missing. The ATX specification might suggest 12 seconds, but could Windows perhaps adapt its kernel dump behaviour – dumping much sooner than 8 seconds – based on the motherboard it’s running on, maybe through information provided by the chipset drivers?

I would love it if someone more knowledgeable than me can help us unravel this small mystery.

About The Author

Thom Holwerda

Follow me on Mastodon @[email protected]