Back to FabImage Studio website

You are here: Start » Filter Reference » System » Process » Execute_WaitForExit_Deprecated

Execute_WaitForExit_Deprecated


Module: FoundationLite

Executes a command using the system console and waits for completion.

Name Type Description
Input value inCommand File System command to be executed.
Input value inArguments StringArray Arguments for the command.
Input value inWorkingDirectory Directory Working directory in which the command will be executed.
Output value outReturnCode Integer Return code of the executed command.
Output value outResult String Captured text data.

Description

Filter executes a command provided in inCommand with inArguments arguments. The command will be executed in a directory provided in inWorkingDirectory.

Output outResult contains all the text captured during the execution of command.

Usually value 0 on output outReturnCode means that command was executed correctly.

Program execution is blocked until command execution is finished.

Examples

Description of usage of this filter can be found in examples and tutorial: Starting Notepad with Execute filter, Turning computer off using Execute.

To get list of files on the C drive, working directory should be set to C:\ and command should be set to dir. On Linux ls command should be used.

Example below shows how to shut down computer at desired time using Execute_WaitForExit_Deprecated filter.

Remarks

During the command execution, system console may appear. It could cause loss of the focus on the HMI form.

Usage of this filter is not recommended in FIL.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

If an error occurred during the process execution a value -1 will be returned on outReturnCode.

List of possible exceptions:

Error type Description
DomainError Could not remember current working directory.
DomainError Provided inWorkingDirectory is incorrect or not found. Path: provided working directory
DomainError Provided inWorkingDirectory user provided directory is incorrect or not found.
RuntimeError Could not return from working directory.

Complexity Level

This filter is available on Advanced Complexity Level.

Disabled in Lite Edition

This filter is disabled in Lite Edition. It is available only in full, FabImage Studio Professional version.