Sys_WaitForMaxNumberOfProcesses
Description
Section titled “Description”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.
Syntax
Section titled “Syntax”Sys_WaitForMaxNumberOfProcesses(sProcessExeName, iMaxWaitSec, iIntervalSec, iNumberOfProcesses) As Boolean
Parameters
Section titled “Parameters”sProcessExeName (String)
Section titled “sProcessExeName (String)”File name of the process, for example msiexec.exe
iMaxWaitSec (Integer)
Section titled “iMaxWaitSec (Integer)”Maximum number of seconds to wait. Must be equal to or larger than iIntervalSec.
iIntervalSec (Integer)
Section titled “iIntervalSec (Integer)”Number of seconds between each check
iNumberOfProcesses (Integer)
Section titled “iNumberOfProcesses (Integer)”The function stops waiting when fewer processes than this are running
Return value
Section titled “Return value”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.
Example
Section titled “Example”If bStatus Then bStatus = Sys_WaitForMaxNumberOfProcesses("msiexec.exe", 300, 10, 2)Related functions
Section titled “Related functions”Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_CompareProcessOwner Constants Package Property Variables