-1

There are rare occasions when I'm not sitting at the PC, and the Windows power system commands are just not going to work for me. I need to programmatically force Windows to stop immediately, regardless of the potential for data loss, or risk that the PC might not boot again. Normally to forcefully stop Windows, I would either hold the power or reset button down for > 10 seconds, remove the battery or AC power.

Unless absolutely necessary, please explain to users that they should never force a Windows shutdown or reboot. Or, if they do, explain the risks of lost files or failure to boot.

When would I need this?

  • Windows can't shut down some process - It ignores any "Quit Windows" commands.
  • System is so busy and slow, it will (almost) never finish shutting down and:
  • ... ---> The mouse or keyboard is almost frozen and it takes 5 minutes to even try to initiate power commands.
  • ... ---> Windows will likely take an hour to finish a coordinated and safe shutdown or reboot.
  • It is physically impossible to press reset or remove AC/DC power from PC, since I'm not at the PC.
  • Malware appears to be actively encrypting files or popping up an infinite number of new windows.

Without writing a new program, how can I force a shutdown or reboot, when the normal powerCFG.exe command options fail?

1
  • Use the reset button. Some motherboards still have a reset pin (on the front panel header), although most PC cases omit the front panel button for it.
    – sawdust
    Commented Apr 20, 2017 at 17:32

1 Answer 1

0

Easiest choice, get the free tiny Wizmo.exe from Steve Gibson's http://www.GRC.com/wizmo/wizmo.htm, put it in your Windows\system folder (so you can execute this from anywhere), then execute one of these commands:

  • Wizmo.exe Shutdown!
  • Wizmo.exe Reboot!

I won't list a number of commandline options and programs you could write to do these tasks, when there's a perfectly good choice for most everyone that's free. Steve Gibson from GRC Research wrote a tiny utility to do a complete job, with more options that you'd ever want.

It also includes the option to force these immediately, simply by adding a "!" to any of the commandline options. Steve says,

"The shutdown trigger commands list above accept an optional exclamation point "!". For example: "reboot!" (pronounced "Reboot Damit!"). A word of caution: Since the Damit Variations force the requested function to succeed, even if programs or device drivers have refused to give Windows their permission to be shutdown, you should be certain that this is what you want and that any files are safely saved."

For me, these commands are all I need to force a reboot, although I find the other options such as suspend and hibernate saves time. (Another user's question was removed earlier today and I thought it was a valuable question.)

6
  • 1
    This does not appear to support acting on a remote computer. Commented Apr 20, 2017 at 15:32
  • I'll do a bit of testing, but seems that, if you are executing this as an admin from the console, it should work. @Jeff Zeitlin - If from RDP, seems it should also work with admin rights and other admin commands work.
    – DaaBoss
    Commented Apr 20, 2017 at 15:35
  • If the computer is in a state where it's largely unresponsive (per the question), he might not be able to get into the computer via RDP in the first place... Commented Apr 20, 2017 at 15:42
  • Agree on getting to this when system is that hung up. I suspect we'd need a way to hotkey to it, but then have some confirmation so you can't accidentally execute this dangerous command. I have some thoughts on how to present quite a few of his options in our SnapBack-Apps.com program, vs using a commandline. Plus, in our app, we do allow non-admins to execute a few safe commands, but with the admin's veto option.
    – DaaBoss
    Commented Apr 20, 2017 at 15:57
  • I've been looking for more info, and I can't find anything that lets you do a "crashdown" remotely - There is a WMI class (Win32_Shutdown/Win32_ShutdownTracker) that can be used to shutdown a remote computer, but it does a "clean" shutdown, which is not what the querent needs. Commented Apr 20, 2017 at 16:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .