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

Executing windows cmd command

dave
2023-01-11
2023-01-12
  • dave - 2023-01-11

    I'm looking to find a way to execute a windows command prompt command to either run a python script, or a curl command. Currently my code looks like:
    command := 'cd C:/Users/laptop/Desktop && python file.py';
    SysProcess.SysProcessExecuteCommand(pszComand:=command,pResult := ADR(Result));

    If I change the command to shutdown it works and will turn off my computer. Everything else I've tried does not work.

     
  • spiritcore - 2023-01-12

    I have the same situation.
    It seems like the staff doesn't reply to questions about SysProcess.
    As far as I understand, it does work better on Linux.
    Let's try solving it.
    I already tried 'python --version > c:\test\text.txt' but it doesn't work.
    When trying 'cd c:\test && dir > c:\test\text.txt' I can see the directory listing.
    I wonder if something is allowing it to access only CMD core commands.

     

Log in to post a comment.