Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Shutdown Windows from Control RTE SL

2022-05-08
2022-05-08
  • John Martin

    John Martin - 2022-05-08

    Hi everybody,

    is there any way to shutdown windows 10 from Control RTE?
    For example, a simple button when I press it, shutdown windows.

    Best regards

     
  • John Martin

    John Martin - 2022-05-08

    For other users, this is the code I use with Control RTE SL to shutdown windows.

    VAR
        xShutdown: BOOL;
        Result: RTS_IEC_RESULT;
    END_VAR
    
    IF xShutdown THEN
       SysProcess.SysProcessExecuteCommand('shutdown -s -t 1', ADR(Result));
       xShutdown := FALSE;
    END_IF
    

    And that's all.

    Best regards

     

    Last edit: John Martin 2022-05-08

Log in to post a comment.