dos

Executes a dos command on Windows.

Syntax

R1 = dos(stringCommand)

[R1, R2] = dos(stringCommand)

Inputs

stringCommand
Command to be executed
Type: string

Outputs

R1
The status of the dos command executed
Type: integer
R2
Optional output which contains any text echoed to standard output when the system command is executed.
Type: string

Examples

Run the dos command, without retrieving the output:
R = dos('echo %date% %time%')
R = 0
Run the dos command, with the text displayed to standard output:
[R1, R2] = dos('echo %date% %time%')
R1 = 0
R2 = Fri 02/09/2018 12:24:58.52

Comments

It is necessary to set the ALTAIR_HOME variable to empty before calling any Altair product from inside Activate. To do this, append "set ALTAIR_HOME=&" to the string command to be executed in the system function.

For example, default call of MotionSolve in the command shell:
"C:/Program Files/Altair/2021/hwsolvers/scripts/motionsolve.bat" solverdeck.xml
The same call of MotionSolve through the Activate system function:
system('set ALTAIR_HOME=&"C:/Program Files/Altair/2021/hwsolvers/scripts/motionsolve.bat" solverdeck.xml');