---
title: Exec
slug: exec
docTags: 
createdAt: 2023-04-19T13:52:45.000Z
---

Starts an external program within the job/macro and waits until the program exits. The return value of the program is stored in [variable](docId\:oqHjs3LLCfQkSac_cemc2) `#5399`

:::BlockQuote
Exec "\<program path>" "\<command line parameter>" \<timeout\[ms]>
:::

The maximum wait time is 10 minutes.

### Example

:::BlockQuote
Exec "notepad.exe" "hello.txt" 6000

:::

This executes notepad.exe and waits 1 minute for it to exit.
An error is generated if it does not exit within the specified time.

