# uexecute command

The uexecute command allows users to execute various Windows programs
 from within mvBASIC.

## Format

```
UEXECUTE <command> [RETURNING var]
```

## Parameters

| command | Any valid Windows program within quotes. |
| --- | --- |
| var | Contains an identifier used in a umessage or uwaitfor command. |

## Description

If the RETURNING clause is used, the specified *var* contains an identifier
 used in either a umessage or uwaitfor command. This
 identifier is only valid while the previously launched uexecute command is
 running.

 If the RETURNING clause is not used, the uexecute command does not return
 control to the mvBASIC program until the launched command terminates.

## Example(s)

To execute the Windows program NOTEPAD:

```
*
* Launch notepad. Program will not resume
* until notepad is terminated.
*
UEXECUTE "NOTEPAD.EXE"
*
* Launch Notepad; sleep for 2 seconds then close
*
UEXECUTE "NOTEPAD.EXE" RETURNING HANDLE
SLEEP 2
UMESSAGE TO HANDLE,16,0,""
```

## See also

- [O/S interoperability commands and functions](https://d3codex.com/pickbasic-flashbasic/os-interoperability-commands/)
- [uclose command](https://d3codex.com/pickbasic-flashbasic/uclose-command/)
- [ucreate command](https://d3codex.com/pickbasic-flashbasic/ucreate-command/)
- [udelete command](https://d3codex.com/pickbasic-flashbasic/udelete-command/)
- [uerror() function](https://d3codex.com/pickbasic-flashbasic/uerror-function/)
- [ulock command](https://d3codex.com/pickbasic-flashbasic/ulock-command/)
- [ulseek() function](https://d3codex.com/pickbasic-flashbasic/ulseek-function/)
- [umessage command](https://d3codex.com/pickbasic-flashbasic/umessage-command/)
- [uopen command](https://d3codex.com/pickbasic-flashbasic/uopen-command/)
- [uread command](https://d3codex.com/pickbasic-flashbasic/uread-command/)
- [ureadline() function](https://d3codex.com/pickbasic-flashbasic/ureadline-function/)
- [usystem() function](https://d3codex.com/pickbasic-flashbasic/usystem-function/)
- [uwaitfor command](https://d3codex.com/pickbasic-flashbasic/uwaitfor-command/)
- [uwrite command](https://d3codex.com/pickbasic-flashbasic/uwrite-command/)

---
Source: https://d3codex.com/pickbasic-flashbasic/uexecute-command/ - part of the D3Codex reference.
