title: Trying to get Codesys to run a batch file from the HMI
body: <p>So currently, I am trying to pick up this code that an intern left off for this project. I have a batch file that is run when clicked, and will execute a powershell script that will convert a generated CSV file from collected data to an Excel file. I am trying to get this process to happen automatically when a button is clicked in the HMI, but am not sure how to call a batch file in Codesys.</p>
  
  <p>I have tried calling the batch file in different places of my code. Nothing will run it when the button is clicked.</p>
  
  <pre><code>FUNCTION ScriptExecute 
  VAR
      szStdOout : STRING(100);    
      dutResult : sysfile.RTS_IEC_RESULT;
      szCommand: STRING;
  END_VAR
  </code></pre>
  
  <pre><code>szCommand := '/home/cds-apps/PlcLogic/data/ psExecuter.bat';
  SysProcess.SysProcessExecuteCommand2(pszCommand:=szCommand, pszStdOut:=szStdOout, udiStdOutLen:= SIZEOF(szStdOout), pResult := ADR(dutResult));
  </code></pre>
  
  <p>No errors come up with this code, I just want to find a way for the batch file to be executed automatically when the user clicks the specific button. Currently the  user would have to manually go into the file explorer and run the batch file themselves.</p>