Example 3 in the scripting index
RunProgram set up to feed commands to CMD.exe
is one way.
Another way would use a command separator within the parameters. Modified from example 1:
RP = Run Program(
Executable( "CMD.EXE"/*path probably not needed*/ ),
Options( {"/a", "/q", "/c dir && echo hello && ping localhost"} ),
ReadFunction( Function( {this}, Write( this << read ) ) )
);
(Both of the above are set up to read from cmd.exe, as it runs, and write the answers to the JMP log. Your original example with readfunction("text") is the simpler, less flexible way that gathers all the output and presents it at the end.)
Craige