# RunProcess

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Utilities/tree/main/Frends.Utilities.RunProcess>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                        | Description                                                                                                                                                                                               |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FileName : `String`         | <p>An application or document with which to start a process. Use cmd.exe to execute command on "command line".</p><p><br>Default: <code>cmd.exe</code><br>Example: <code>cmd.exe</code></p>               |
| Arguments : `String[]`      | <p>Command-line arguments to use when starting the application.</p><p>For Windows use /C start and on Unix use -c.</p><p><br>Default: <code>-</code><br>Example: <code>\[ "/C", "echo Hello" ]</code></p> |
| WorkingDirectory : `String` | <p>Working directory for the process.</p><p><br>Default: <code>-</code><br>Example: <code>/working/directory OR C:\working\directory</code></p>                                                           |
| {% endtab %}                |                                                                                                                                                                                                           |

{% tab title="Parameter: Options" %}

| Name                                      | Description                                                                                                                                   |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| TimeoutSeconds : `Int32`                  | <p>Timeout in full seconds</p><p><br>Default: <code>30</code><br>Example: <code>30</code></p>                                                 |
| KillProcessAfterTimeout : `Boolean`       | <p>Kill the process after timeout</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                     |
| RedirectStandardInput : `Boolean`         | <p>true if input should be read from StandardInput; otherwise, false</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>   |
| ThrowExceptionOnErrorResponse : `Boolean` | <p>true if the task should throw exception when return code is not 0.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p> |
| {% endtab %}                              |                                                                                                                                               |

{% tab title="Result: Result" %}

| Name               | Description                                                                                                  |
| ------------------ | ------------------------------------------------------------------------------------------------------------ |
| ExitCode : `Int32` | <p>The status that the process returned when it exited.<br>Example: <code>0</code></p>                       |
| Output : `String`  | <p>The process normal output (STDOUT)<br>Example: <code>testvalue</code></p>                                 |
| StdErr : `String`  | <p>The process error output (STDERR)<br>Example: <code>The system cannot find the file specified.</code></p> |
| {% endtab %}       |                                                                                                              |

{% tab title="Changelog" %}

## Changelog

### \[1.1.0] - 2024-05-16

#### Added

* You can now specify working directory for the process to run in (#12)

#### Fixed

* Fixed a bug where the process is executed twice (#11)

### \[1.0.0] - 2024-02-09

#### Changed

* Initial implementation
  {% endtab %}
  {% endtabs %}
