Process Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Process Operations >

Process Commands

CPR. - Close Process

Previous Top Next


MiniRobotLanguage (MRL)

 

CPR. Command

Close Process

 

 

Intention

 

Close Process by Process-ID (#pid#). This command will end a running process.

This is done in 2 stages.

First the command first tries to send a "Close-Message" to the Process-Mainwindow.

It then waits for a specified time.

Second, if the process does not end within the given waiting time, (if it hangs), the process is forcefully closed.

 

CPR. can be use in three  ways:

 

' This will close the process from the last localized window

CRP.

 

' This will close process with PID in $$PID and a

' waiting time of 1 second (default waiting time).

' CPR.$$PID

 

' This will close the process from the last localized window

' with a waiting time of $$WAT milliseconds.

' CPR.|$$WAZ  

 

 

' This will close the process with the given PID ($$PID)

' with a waiting time of $$WAT milliseconds.

' CPR.$$PID|$$WAZ

 

' This will immediately, forcefully close the process

' with the given PID ($$PID)

' CPR.$$PID|0

 

 

 

Syntax

 

CPR.P1|P2

 

Parameter Explanation

 

P1 - PID of the process to close

 

P2 - Waiting time in ms before forcefully closing the process.

 

 

 

Example

 

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

' CPR.-Demo

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

DBM.2

' Get the PID using IEP.command

IEP.Testapp_01.exe

' Close the App with 5 Seconds waiting time

 CPR.#pid#|5000

ELS.

 MBX. That Application is not running!

EIF.

ENR.

 

 

 

Remarks

 

Tested: XP, Win7/x64

 

 

Limitations:

 

-

 

 

See also:

 

  1.7. Application and PID

  IEP. / NEP. - If-Exists-Process

  FEP. - For-Each-Process

  CLW. - Close-Window

  CAW. - Close-All-Windows

  CTR. - Close-ThRead

  CPR. - Close-PRocess

  KPN. - Kill Process by Name

  GDF. - Get-Data-From

  GPU. - Get Process User