Under Windows XP Pro in a networked environment such that Ctrl+Alt+Del gives you the Windows Security prompt, if you hold Ctrl and click shutdown it triggers an Emergency Shutdown.
This appears to turn off the system so fast it doesn't even what for processes to finish, i.e. almost as if you just pulled the power/long-held the power button.
I am wondering by what process Windows achieves such a quick shutdown - is it instructing the BIOS directly via ACPI/APM to power down the system? If so, how could this be achieved programatically in any language?
This can be accomplished on *nix systems by using the system requests feature. Generally this is disabled for security reasons, but you can enable it with root privileges and request power off to the system immediately as follows:
echo 1 > /proc/sys/kernel/sysrq-trigger ;
echo o > /proc/sysrq-trigger
where the letter 'o' means "power off". Other functions are available. https://en.wikipedia.org/wiki/Magic_SysRq_key