Run an operating system command or start an application as child process. The output produced by the child process is written to the AutoShell console by default. Optionally, redirect the output to an AutoShell OSRedirect object.
The command has the following syntax:
! cmd [-output osRedirect]
Specifies a command to execute or application to run. Multiple commands can be concatenated using a && sequence. Unquoted argument tokens are automatically stringified. Prevent automatic quoting for expressions by placing expression code into parenthesis.
(Optional) Existing OSRedirect object to receive the output of the child process.
Default: ""
Examples
Display the version string of a Windows OS:
! ver
Display the version string of a Windows OS display current directory:
! ver && cd
Ping a system on the network and capture output:
out=new OSRedirect(); ! ping 192.168.0.100 -output out if(out.result()==0) { ? out.output(); } else { ? "Ping failed" }
Copyright © 2013 CA. All rights reserved. |
|