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?