> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ntop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Command

## About this Block

**What it does:** The **Run Command** block allows users to run any command-line command directly within nTop. This block enables the execution of diverse external processes, such as executing complex simulations, interfacing with external design tools, or integrating manufacturing processes.

**Common uses:**

* Connecting applications: Any command line executables of design, analysis, or manufacturing software and tools
* Automation: Execute Command Line or PowerShell commands for automation.
* Scripting: Execute commands in Python, Lua, or any other scripting language you choose.

**Tips:**
[Run Command Security Warning](https://storage.googleapis.com/files-learn/static/ExtendedBlockDocs/RunCommand.png)

* Permission Setting for Run Command blocks
  * nTop will prompt you with a Security Warning to trust Run Command blocks before allowing them to run because Run Commands could contain security hazards. You can select the preference of your permission setting from Settings > Data > Run Command (Beta). Learn more about the settings available [Run Command Permission Settings](/_user_interface/_settings/run_command.html).
* Working Directory Input
  * The Working Directory input lets you set a relative directory dynamically associated with the process.
  * Note: The default Working Directory is not where your file is located. It is the directory of the parent process. This means the default directory depends on how nTop is opened; opening nTop from the standard installation will result in the directory "C:\Program Files\nTopology\nTopology". This will be different if you open or execute the nTop Notebook via PowerShell. Running an external process through the default nTop directory could lead to library collisions.
  * If you experience library collisions, please set a Working Directory manually.
* The [Await](/block-documentation/blocks/utilities/general/await.html) block
  * The Await custom block lets you pause and wait for a block completion before running the **Run Command** Block.
  * In practical terms, utilizing the command input for the **Run Command** block ensures optimal functionality, allowing the **Run Command** block to patiently wait for the output from the Await block upon the **Export Mesh**'s completion.
  * An example of this is when the execution of the **Run Command** Block is based on the completion of an **Export Mesh** block.
  * The Await block contains two input variables of Any type to facilitate this synchronization.
  * The first input, *Await*, is for the block awaiting completion. The second input, *Return*, is the output once the Await is completed.

## Example File

Download Example: [Run Command with Await](https://storage.googleapis.com/files-learn/static/ExtendedBlockDocs/run_command_await.ntop)

This [support article](https://support.ntop.com/hc/en-us/articles/23766024928787) has different examples of using the **Run Command** block.

***

Run an external command, capturing the exit code, standard output, and standard error.

### Inputs

| Name              | Type                                                   | Description                                                       |
| ----------------- | ------------------------------------------------------ | ----------------------------------------------------------------- |
| Command           | [Text](../../../../block-documentation/types/text)     | Command to execute.                                               |
| Log output        | [Bool](../../../../block-documentation/types/bool)     | If checked, write standard output to the nTop Log Panel.          |
| Log error         | [Bool](../../../../block-documentation/types/bool)     | If checked, write standard error to the nTop Log Panel.           |
| Timeout           | [Scalar](../../../../block-documentation/types/scalar) | Option to cancel execution if unfinished after a set time period. |
| Working directory | [Path](../../../../block-documentation/types/path)     | Option to set a working directory for external command.           |

### Outputs

| Type                                                                   |
| ---------------------------------------------------------------------- |
| [Command Output](../../../../block-documentation/types/command-output) |
