Ext.CmdLineWait()

(SBM On-Premise only) Executes the string cmdLine in the operating system's command line interpreter and waits for the command to finish.

Function Signature

 int Ext.CmdLineWait( cmdLine )

Parameters

Parameter Type Description

cmdLine

string

This argument can contain redirect symbols, pipe characters, wildcards, and anything else legal at a command line prompt. The Operating System account that is executing the script on the server requires privilege to perform any command is invoked.

Return

Type Description

int

The command line interpreter's return value, which is the exit code of the program or batch file called.

Technical Details

SBM ModScript version: 11.3.

Notes

For the return value, a program that does not generate a runtime error and does not call the "exit" statement has an exit code of zero. A batch file has an exit code of zero if its last executing line is not a runtime error or an "exit" statement. If a runtime error occurs in a program or batch file, the exit code is an OS error number, usually a large negative number. If an "exit" statement executes, its numeric parameter is the exit code. When a batch file uses the DOS "exit" statement with the "/B" option, the "exit" parameter is ignored, and the exit code is zero.
Note:  The "return" statement offered in C/C++ (and other programming languages) is not the same thing as the "exit" statement, and its parameter value has no effect on the exit code.

When searching for applications or batch files, the ScriptAppPath registry setting is not used, but the OS %Path% variable is. Refer also to Ext.NewTask() and Ext.NewTaskWait().

Related Topics

Extension Functions