# MosProcessExecuteResult

The MosProcessExecuteResult object contains fields representing the result of running an external program.

### Fields <a href="#h.o1rfpn6or86b" id="h.o1rfpn6or86b"></a>

| **Name**  | **Description**                                                                                                                                    |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| hasExited | Indicates completion of program execution or exceeding the waiting time. *True* – the program is complete, *False* – the waiting time is exceeded. |
| exitCode  | Contains the program exit code. Note that if the time of waiting for program execution was exceeded, exitCode will be -1.                          |
| output    | Contains the standard output of the program if it has been completed.                                                                              |

### Examples <a href="#h.8lais511tq7u" id="h.8lais511tq7u"></a>

The following example shows an expression that returns the hostname of the host where the server is deployed using the standard output of the hostname command:

```javascript
var result = MosProcess.runAndWait('hostname', '', 5000);
return result.output;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/scripts/api/mosprocessexecuteresult.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
