Sys_GetProcessOwner
Description
Section titled “Description”Returns the owner of a running process, that is the user account that the process runs as.
Syntax
Section titled “Syntax”Sys_GetProcessOwner(sProcess, bMustExist) As Boolean
Parameters
Section titled “Parameters”sProcess (String)
Section titled “sProcess (String)”File name of the process, for example explorer.exe
bMustExist (Boolean)
Section titled “bMustExist (Boolean)”If True, the function returns False when the process isn’t running
Return value
Section titled “Return value”The owner is stored in gsValue as Domain\User. gbValue is True if the process is running, otherwise False, and gsValue is then empty.
If more than one process has the name, gsValue contains the owner of the last one found.
Example
Section titled “Example”If bStatus Then bStatus = Sys_GetProcessOwner("CapaInstaller.exe", True)If bStatus Then bStatus = Job_WriteLog("Custom", "gsValue: " & gsValue, bStatus, True)Related functions
Section titled “Related functions”Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_ExistProcess Sys_CompareProcessOwner Constants Package Property Variables