IntControl (68, 0, p2, p3, 0)
This will cause a shutdown of the machine, awaiting power off.
p2 Meaning
0 default. Normal shutdown. User is prompted for open files.
1 Force. Forces the reboot of the system by not giving notice to any running applications about the reboot. This doesn't allow the applications to save information or to display shut down messages.
p3 Meaning
0 Power-off if supported by the computer (*see note below*)
1 Don't attempt to power-off
2 Attempt to power-off in any case
Note: We don't currently have a reliable method of determining if a computer supports the power-off feature, so 0 will attempt to do a power-off in any case.
Returns 0.
Be very careful using IntControl(68,0,1,0,0). This can cause the loss of data.
Note: This function is not supported when the script is running as a native service.