# Sys_WaitForMaxNumberOfProcesses

> Searches for a specified process. If specified process count is larger or equal to iNumberOfProcesses the function will wait.

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

### Description

Searches for a specified process. If specified process count is larger or equal to iNumberOfProcesses the function will wait. It will check every iIntervalSec at a max of iMaxWaitSec

### Syntax

Sys_WaitForMaxNumberOfProcesses(sProcessExeName, iMaxWaitSec, iIntervalSec, iNumberOfProcesses) As Boolean

### Parameters

#### sProcessExeName (String)

Name of process

#### iMaxWaitSec (Integer)

Maximum wait time

#### iIntervalSec (Integer)

Interval for each check

#### iNumberOfProcesses (Integer)

Number of proccesses

### Return value

If the number of processes does not get lower than iNumberOfProcesses before iMaxWaitSec the function will return false

### Example

**VBScript**

```vb
If bStatus Then bStatus = Sys_WaitForMaxNumberOfProcesses(sProcessExeName, iMaxWaitSec, iIntervalSec, iNumberOfProcess)
```

[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/)
