DO declare
LOCAL cMachineName, nResult
cMachineName=""
nResult=InitiateSystemShutdown(cMachineName,;
"System Shutdown initiated...", 10, 0, 1)
IF nResult = 0
* Common reasons for failure include an invalid
* or inaccessible computer name or insufficient privilege.
* 5 = ERROR_ACCESS_DENIED
* 53 = ERROR_BAD_NETPATH
* 120 = ERROR_CALL_NOT_IMPLEMENTED -- not supported in Win9*
? "Error code:", GetLastError()
ENDIF
PROCEDURE declare
DECLARE INTEGER GetLastError IN kernel32
DECLARE INTEGER InitiateSystemShutdownA IN advapi32;
AS InitiateSystemShutdown ;
STRING lpMachineName, STRING lpMessage,;
INTEGER dwTimeout, SHORT bForceAppsClosed,;
SHORT bRebootAfterShutdown
|