# Sys_GetProcessID

> Gets the process ID's found for an exe name.

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

### Description

Gets the process ID's found for an exe name

### Syntax

Sys_GetProcessID(sProcessExeName, bReturnAsArray, bMustExist) As Boolean

### Parameters

#### sProcessExeName (Boolean)

Name of process to check

#### bReturnAsArray (Boolean)

Store result in gaValue

#### bMustExist (Boolean)

Process must exist

### Return value

Result will be stored in gsValue. If specified result is stored in gaValue

### Example

**VBScript**

```vb
If bStatus Then bStatus=Sys_GetProcessID("CapaInstaller.exe", True, False)
If bStatus And IsArray(gaValue) Then
  For index = LBound(gaValue) To UBound(gaValue)
    bStatus = Job_WriteLog("Custom", "Index #" & index & ": " & cStr(gaValue(index)), bStatus, True)
  Next
End If
```

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

### Related functions

[Sys_WaitForProcess](/capainstaller/vb-scripting-library/system-functions/sys-waitforprocess/) [Sys_Sleep](/capainstaller/vb-scripting-library/system-functions/sys-sleep/) [Sys_KillProcess](/capainstaller/vb-scripting-library/system-functions/sys-killprocess/) [Sys_GetProcessOwner](/capainstaller/vb-scripting-library/system-functions/sys-getprocessowner/) [Sys_CompareProcessOwner](/capainstaller/vb-scripting-library/system-functions/sys-compareprocessowner/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
