Skip to content

Sys_GetProcessID

Gets the process IDs of the running processes with the specified name.

Sys_GetProcessID(sProcessExeName, bReturnAsArray, bMustExist) As Boolean

File name of the process, for example notepad.exe

True stores the IDs of all the processes in gaValue. False stores the ID of the first process found in giValue.

If True, the function returns False when the process isn’t running

If bReturnAsArray is True, the process IDs are stored in gaValue. Otherwise the ID of the first process found is stored in giValue.

If the process isn’t running and bMustExist is False, gbValue is False, the function returns True, and gaValue and giValue aren’t updated.

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

Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_CompareProcessOwner Constants Package Property Variables