Skip to content

Sys_GetProcessOwner

Returns the owner of a running process, that is the user account that the process runs as.

Sys_GetProcessOwner(sProcess, bMustExist) As Boolean

File name of the process, for example explorer.exe

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

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.

If bStatus Then bStatus = Sys_GetProcessOwner("CapaInstaller.exe", True)
If bStatus Then bStatus = Job_WriteLog("Custom", "gsValue: " & gsValue, bStatus, True)

Scripting Guidelines

Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_ExistProcess Sys_CompareProcessOwner Constants Package Property Variables