Process Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Process Operations >

Process Commands

GPI. - Get Process Information

Previous Top Next


MiniRobotLanguage (MRL)

 

GPI. Command

Get Process Information

 

 

Intention

 

This command will provide you with informations about a specified process.

 

If you just call it without any parameters, it will examine the robot program itself. The code is very simple:

 

GPI.

 

And as result, the stack will look like this:

 

graphic

 

The order of the information is:

    32  - shows you the process is an x32 process. if it would be a 64, it would be a x64 process.

    c.\ ...  - thats the complete path of the examined process

    1440 - this is the PID of the parent process. This is the process that has started the executable.

    2548 - this is the PID of the examined process itself

    MR01.exe - this is just the process name. Like you see it in the task manager.

 

 

Now lets examine another process.The code is:

 

STS.CLEAR

STS.LOCAL

 

GPI.x64.exe

MBX. Process ID is: #pid#

 

ENR.

 

Now this is the stack:

graphic

 

Again, the order of the information is:

    64  - shows you the process is an x64process.

    c.\ ...  - thats the complete path of the examined process

    1804 - this is the PID of the parent process. This is the process that has started the executable. In fact its the "explorer.exe", see picture below.

    2768 - this is the PID of the examined process itself

    x64.exe - this is just the process name. Like you see it in the task manager.

 

graphic

 

If you have multiple EXE running with the same name, you can specify a number.

 

For example, if you have two equal x64.exe applications.

 

graphic

 

STS.CLEAR

STS.LOCAL

GPI.x64.exe|1

GPI.x64.exe|2

DMP.6

MBX.Sample 1

 

You will get this stack:

 

graphic

 

The Systemvariable #pid# is always set to the EXE's Process-ID. Please note that #tid# is always set to zero.

 

You can specify a full path, or only the filename or a part of it.

 

If a process is found, valuable information is placed on the actual stack. These include the full name and path of the executable.

 

Below are two snapshots of the windows-taskmanager. The executable "Skype.exe" has the PID (process-id) 4600. Its on the stack on position 02 in the picture above.

 

The 2312  which is on position 01 (picture above) is the parent-process, that is the process which has started "skype.exe".

 

In the task manager, we can see that this is the PID of the windows-explorer. This way you can find out which process has started another process.

 

If you give GPI. a variable as third parameter, then the stack will not get the full path of the found file. You will find it in the given variable instead.

 

Please note that the stack organization  (see 2.4 The global and local Stack ) as Que or as Stack will influence the sequence in which the items appear on the stack.

 

graphic graphic

 

You can also use GPI. to get information about a process, if you just have the PID. For this you have two choices. Here is the first:

 

GPI.>4600

 

graphic

 

Alternative there is a slower, yet more in depth method. Like this:

 

GPI.<4600

 

graphic

 

The stack shows you the following information:

 

    32 - its a x32 process. Otherwise it would be a 64 if its a x64 process.

    4600 - the PID of the examined process

    c:\... the full path of the process.

    skype.exe - just the name of the process

    the name and .path of the parent process that started this process

    the PID of the parent process

 

 

You  can read more details on how Applications and PID's in the chapter 1.7. Application and PID.

 

 

Syntax

 

 

GPI.P1[|P2][|P3]

 

 

 

Parameter Explanation

 

There are three Usage Mods.

"process name mode"

P1 - Variable or Exe-Filename, with or without path. Pattern can be used.

P2  - Variable/Number/Formula - Number of result (take fist, second etc. fitting result)

P3  - Variable if given gets the full path of the found exe

 

"PID Info Mode 1": Get basic infos about a process.

P1 - Starting with a ">"-Sign this indicates that we are in this Mode. Now follows a PID. Description see  above.

 

"PID Info Mode 2": Get detailed Infos about a process.

P1 - Starting with a "<"-Sign this indicates that we are in this Mode. Now follows a PID. Description see  above.

 

 

Example

 

'***********************************

' GPI.-Demo

'***********************************

STS.CLEAR

STS.LOCAL

 

GPI.

DMP.6

MBX.Sample 1

 

 

 

 

Remarks

 

x64 tested.

 

 

Limitations:

 

no Limitations.

 

 

 

See also:

 

    1.7. Application and PID

    GPU. - Get Process User

    FEP. - For-Each-Process

    GDF. - Get-Data-From

    WPR. - Wait-Process-Running

    WPT. - Wait-Process-Termination

    3.3 Specialfolders