<< Click to Display Table of Contents >> Navigation: 3. Script Language > Process Operations > Process Commands |
MiniRobotLanguage (MRL)
GPU. Command
PID to User-Login Information (User-Name and Domain)
Intention
If you specify a PID, the command will provide you with the user-name and Domain information of the user that started the program. This command can be used to find out, which user has locked a workstation.
VAR.$$FIL=?exepath\Sample Apps\TestApp_01.exe
FPI.$$FIL|$$PID
DBP.PID is:$$PID
' Now we get the Username and Domain from the user that started
' the program with that PID
GPU.$$PID
' Its all on the stack
STS.DUMP
MBX.!
ENR.
You can provide variables then the results will be in these variables. See this example:
VAR.$$FIL=Testapp&AND:01.exe
FPI.$$FIL|$$PID
GPU.$$PID|$$USR|$$DOM
DBP. Username is: $$USR
DBP.Domain is: $$DOM
ENR.
Hints:
1. Use the FPI.-command to get the PID from a filename.
2. To find out if a user is loged in and has just "Locked" his workstation, you can get the PID from "Explorer.exe", using FPI. and if you get one, find out which user is still logged on using GPU..
Syntax
GPU.P1[|P2][|P3]
Parameter Explanation
P1 - PID of the process to analyze
P2 - (optional) Variable for the resulting Username. If omitted,
TOS is used.
P3 - (optional) Variable for the resulting Domain information.
If omitted, TOS is used.
Example
'***********************************
' GPU.-Demo
'***********************************
' STW. will automatically set #pid#
' to the PID of the program that created the window.
STW.ct|PBWindowClass:0|TestApp
SCW.nct|1|Static|This is a Text in the TestApp.
VAR.$$PID=#pid#
' Get the Path of a program
FPI.>$$PID|$$FIL
GPU.$$PID|$$USR|$$DOM
DBP. Username is: $$USR
DBP.Domain is: $$DOM
ENR.
Remarks
-
Limitations:
-
See also:
• GPI. - Get Process Information
• IEP. / NEP. - If-Exists-Process
• WPT. - Wait-Process-Termination