# runCommand

Run an executable with arguments on the server providing the web service. The command is run within the environment and under the user privileges of the user who is running the Tomcat Server.

## &inp;

### runCommand input parameters

parameter | type | required | description
--- | --- | --- | ---
executable | String | Yes | Command to be run. The command may be specified with full path using forward slash "/" as path separator.
argline | String | No | Any command line arguments
&param-timeout;

## &outp;

Sample request: Start Windows Command Interpreter and print "Hello World" to STDOUT.

    	<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
       <soapenv:Header/>
       <soapenv:Body>
          <ws:runCommand>
             <executable>c:/windows/system32/cmd.exe</executable>
             <argline>/C "echo Hallo Welt!"</argline>
             <timeout>3000</timeout>
          </ws:runCommand>
       </soapenv:Body>
    </soapenv:Envelope>

Sample response:

    	<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <ns2:runCommandResponse xmlns:ns2="http://ws.xservices.brutex.net">
             <return>
                <returnCode>0</returnCode>
                <stdOut/>
                <stdErr/>
                <propertyList>
                   <name>ExecuteService.result</name>
                   <value>0</value>
                </propertyList>
                <propertyList>
                   <name>ExecuteService.stdout</name>
                   <value>Hallo Welt!</value>
                </propertyList>
                <propertyList>
                   <name>ExecuteService.stderr</name>
                   <value/>
                </propertyList>
             </return>
          </ns2:runCommandResponse>
       </soap:Body>
    </soap:Envelope>

Sample request: Start notepad.exe and close it after 15 seconds.

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
       <soapenv:Header/>
       <soapenv:Body>
          <ws:runCommand>
             <executable>c:/windows/system32/notepad.exe</executable>
             <argline></argline>
             <timeout>15000</timeout>
          </ws:runCommand>
       </soapenv:Body>
    </soapenv:Envelope>