System Delphi

SetSystemPowerState(False, True); //Forces the system down
SetSystemPowerState(True, False); //Makes a "soft" off