Promotic

ShutDown - method of the Pm object

Description:
Shutdown of the Windows OS.
Syntax:
Empty ShutDown(Long nAction, Boolean bHard)
Parameters:
nAction(Long) The way how the Windows OS has to be shut down.
0 - Logging off the user logged into the Windows OS is performed
1 - Restart of the computer is performed
2 - Switching off the computer is performed
bHard(Boolean) Value of the parameter.
true - all tasks are forced to terminate (it can occur to the data loss)
false - the applications are asked if there is possible to terminated their function
Note:
For this method the "AppStop" permission does not have to be fulfilled, in order to launch computer shut down (or restart) by external event without the user intervention (UPS signal, watchdog, etc.). If the method launch is to be enabled only for authorized user, then it is necessary to test the user permission by the Pm.TestUserInGroup method, see the example no. 2.

This method is not functional in Web panels.
See also:
- Pm.AppStop (method)
Example1:
JavaScriptVBScriptSelect and copy to clipboard

Pm.ShutDown(1, true);
Example2:
Launching the computer restart while testing whether the local user is a member of the $OPER user group.
JavaScriptVBScriptSelect and copy to clipboard

if (Pm.TestUserInGroup(0, "$OPER"))
{
Pm.ShutDown(1, true);
}
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- ShutDown
 
 
- Sin
- Tan
© MICROSYS, spol. s r.o.