|
|
|
|
|
- Properties specific to Command variables
- Functions that use Command variables
Command (Variable type) In french: Command
The Command type defines all the advanced characteristics of a command used for an executable file. You can define and change the characteristics of this command using different WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
MyCommandToExecute is Command
MyCommandToExecute = "C:\Path\MyProgram.exe"
MyCommandToExecute.Arguments = "Argument1"
MyCommandToExecute.Streams = cmdStandardInput + cmdStandardOutput
CmdAddArgument(MyCommandToExecute, "Argument2")
CmdAddOption(MyCommandToExecute, "opt1", "val1")
CmdExecute(MyCommandToExecute, False)
CmdWriteStandardInput(MyCommandToExecute, "Write test" + CR)
code is int = CmdGetExitCode(MyCommandToExecute, True)
stdout is string = CmdReadStandardOutput(MyCommandToExecute)
stderr is string = CmdReadErrorOutput(MyCommandToExecute)
Properties Properties specific to Command variables The following properties can be used to define the characteristics of Command variables: | | | Property name | Type used | Effect |
---|
Arguments | Character string | Arguments to pass to the command. The contents of this property replace all previously defined arguments and options. | AutoTerminate | Boolean | - True (default): The executable associated with the command stops if the variable is destroyed or reset to zero.
- False: The executable associated with the command continues to run even if the variable is destroyed or reset ro zero.
Note: You can force the executable associated with a command to stop with CmdKill. Note: This property is only available from version 2025 Update 1. | Executable | Character string | Path to the executable associated with the command. | ID | Integer | Process identifier (Handle or pid). This property is available in read-only mode. | RedirectStdErrToStdOut | Boolean | - True to redirect the STDERR stream to STDOUT.
Please note: Both STDOUT and STDERR must be open. - False otherwise.
| Stream | Integer constant | Stream to be opened: - cmdStandardInput: Standard input stream (StdIn).
- cmdErrorOutput: Standard error stream (StdErr).
- cmdStandardOutput: Standard output stream (StdOut).
By default, all streams are open. |
Remarks Functions that use Command variables | | | Adds an argument to a command to be executed in console mode. | | Adds an option to the command to be executed in console mode. | | Executes a command in console mode. | | Gets the exit code of the command executed in console mode, i.e. the value returned when the command finishes executing. | | Indicates whether the executable associated with a command is currently running. Note: This function is only available from version 2025 Update 1. | | Forces the termination of a running executable associated with a command. Note: This function is only available from version 2025 Update 1. | | Reads error output data for the command executed in console mode. | | Reads standard output data, for the command executed in console mode. | | Writes data to the standard input of the command executed in console mode. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|