Skip to content

Sys_WaitForMaxNumberOfProcesses

Waits until fewer than iNumberOfProcesses processes with the specified name are running. The function checks every iIntervalSec seconds, for up to iMaxWaitSec seconds. The first check is made after iIntervalSec seconds.

The process name is case-sensitive, as in Sys_ProcessCount.

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

File name of the process, for example msiexec.exe

Maximum number of seconds to wait. Must be equal to or larger than iIntervalSec.

Number of seconds between each check

The function stops waiting when fewer processes than this are running

If the number of processes does not get lower than iNumberOfProcesses before iMaxWaitSec the function will return false. The function also returns False if iMaxWaitSec is smaller than iIntervalSec.

giValue contains the number of seconds the function waited.

If bStatus Then bStatus = Sys_WaitForMaxNumberOfProcesses("msiexec.exe", 300, 10, 2)

Scripting Guidelines

Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_CompareProcessOwner Constants Package Property Variables