How can I in a Delphi application (7, trying to port it to 2010) force the system (XP or 7) to shut down?
+5
A:
Look at Zarco Gajic's tip from About.com, "Shut down/reboot Windows 2000/XP/NT."
Serg
2010-03-07 21:09:39
Fantastic, very ruthless, this will save my client a lot of electricity.
herman
2010-03-07 22:09:46
@herman: If there is a chance that the system is running on remote desktop this may not be enough. You need to test, but I remember I had to add special code for an internal app to optionally use the `WTSShutdownSystem()` function, to actually shut down the PC without any request for confirmation.
mghie
2010-03-08 05:09:05