Skip to content

Sys_CompareProcessOwner

Compares the owners (the user accounts) of two running processes.

Sys_CompareProcessOwner(sProcessOne, sProcessTwo, bMustExist) As Boolean

Name of the first process, for example explorer.exe

Name of the second process

If True, the function returns False when one of the processes isn’t running, or when its owner can’t be read

Result will be stored in gbValue: True if both processes run as the same user, otherwise False. gbValue is also False if one of the processes isn’t running.

If bStatus Then bStatus = Sys_CompareProcessOwner("wscript.exe", "explorer.exe", False)
If bStatus Then bStatus = Job_WriteLog("Custom", "gbValue: " & gbValue, bStatus, True)

Scripting Guidelines

Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_ExistProcess Constants Package Property Variables