ars_ExecuteProcess(ctrl, command, runOption=0)

Execute the given command on the server host as the user-id that the server process is running as. Requires Administrator privs to use.
runOption Explanation
0 Wait for process to complete and then returned the process' returnStatus and any output that the process had.
1 Don't wait for process to complete.

On success
Depending upon the runOption specified returns a list of returnStatus and returnString or 1
On failure
Returns undef.

Example:

        (($returnCode, $returnString) = ars_ExecuteProcess($ctrl, "/bin/ls -l /")) || 
                die "$ars_errstr";
      

Or as an equivalent, if your server is running on Windows:

        (($returnCode, $returnString) = ars_ExecuteProcess($ctrl, "cmd /c dir")) || 
                die "$ars_errstr";

ars_ExecuteProcess was introduced in version 1.5 of ARSperl.

Back to Table of Contents

Last changes to this page 31st March 2009 by michiel.beijen@gmail.com
© J.C.Murphy, J.W.Murphy 1997 arsperl@arsperl.org