# Sys_WaitForProcess

> Waits until a specified process has terminated, or the maximum number of seconds has been exceeded.

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

### Description

Waits until a specified process has terminated, or the maximum number of seconds has been exceeded

### Syntax

Sys_WaitForProcess(sProcessExeName, iMaxWaitSec, iIntervalSec) As Boolean

### Parameters

#### sProcessExeName (String)

Name of process

#### iMaxWaitSec (Integer)

Maximum number of seconds

#### iIntervalSec (Integer)

Number of seconds between each process-check

### Example

**VBScript**

```vb
If bStatus Then bStatus = Sys_WaitForProcess("CapaInstaller.exe", 25, 5)
```

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

### Related functions

[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_ExistProcess](/capainstaller/vb-scripting-library/system-functions/sys-existprocess/) [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/)
