Syntax (HOST command)
The minimum specification is the command name HOST
, followed by the keyword COMMAND
, an equals sign (=), and one or
more operating system level commands, each enclosed in quotes, with
the entire set of commands enclosed in square brackets.
Example
HOST COMMAND=['dir c:\myfiles\*.sav'
'dir c:\myfiles\*.sps > c:\myfiles\command_files.txt'
'copy c:\myfiles\file1.txt > c:\myfiles\file2.txt'
'dur c:\myfiles\*.xml > c:\myfiles\xmlfiles.txt'
'c:\myfiles\myjobs\report.bat’].
- The directory listing for all .sav files is displayed in a text output object in the Viewer window.
- The directory listing for .sps files is redirected to a text file; so no output is displayed in the Viewer window.
- If file2.txt does
not already exist, the
copy
command will copy the contents of file1.txt to a new file called file2.txt. If file2.txt exists, thecopy
command will not be executed since this would result in a user prompt asking for the user to confirm overwriting the file. - The invalid
dur
command generates an error, which is displayed in the Viewer, and no output for that command is redirected to specified text file. - The error condition caused by the invalid
dur
command terminates theHOST
command, and report.bat is not run.