# Shell_Execute

> Executes specified program/command using specified options.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/shell-function/shell-execute/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Executes specified program/command using specified options

### Syntax

Shell_Execute(sProgram, sArgument, bWait, iStyle, bCheckProgramExistence) As Boolean

### Parameters

#### sProgram (String)

Program/command to execute

#### sArgument (String)

Command line arguments

#### bWait (Boolean)

Wait for termination before proceeding

#### iStyle (Integer)

[Windows Style Constants](/capainstaller/vb-scripting-library/addendum/windows-style-constants/) (e.g minimized or normal)

#### bCheckProgramExistence (Boolean)

Check for existence of the program

### Return value

giErrorLevel is set and contains the error code returned from the OS

### Example

**VBScript**

```vb
If bStatus Then bStatus = Shell_Execute(gsWindowsDir & "\Regedit.exe", gsTempDir & "\Regfile.reg /S", True, 1, True)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
