Using operating system commands in actions

On Windows, a DOS command can be executed by using the /c option of the command program. A Unix command can be specified directly. For example, if file ‘x’ needed to be copied to file ‘y':

Operating System LexiCom SYSTEM command
Windows 95/98 SYSTEM command.com /c copy x y
Windows NT/2000/XP SYSTEM cmd.exe /c copy x y
Unix SYSTEM cp x y
Note: If the command program can not be found, its location is probably not in the Path environment variable and you may need to specify its full path. The ComSpec environment variable should indicate its full path.

If the program that is being executed prints messages, it may fill up the standard out or standard error buffer and hang execution. To avoid this, pipe all the output to a file:

SYSTEM myprogram.exe > myprogram.log 2 > &1
2 > &1 pipes standard error to standard out.  If you don’t care to capture the output, pipe all the output to keyword ‘nul’:
SYSTEM myprogram.exe  >  nul 2 > &1

Also, when executing LexiCom from the command line, some Unix shells will expand file matching characters - * ? [ ] - ~ { and } - even when enclosed in double quotes - “” (e.g. –c “GET *” expands to –c GET as2bean.jar ftp.jar ftplog.txt …). To avoid this, try enclosing the wildcard character in double quotes “” and the entire argument in single quotes ‘’ (e.g. –c ‘GET “*”’).