Processes - End

Declaration

<AMPROCESSES ACTIVITY="end" DOMAINNAME="text" REMOTEMACHINE="text" USERNAME="text" PASSWORD="text (encrypted)" PROCESSNAME="text" />

Related Topics   

Description

Forcibly ends the running instance of a process.

NOTE: Any data entered or any changes made in the program that has not been saved will be lost. Where possible, it is better to use the Close Window action because it notifies the application before actually shutting it down, thus giving the application time to "clean up".

Practical Usage

Used to force a process (usually a program or .EXE file) to shut down. Although using the Close Window activity will gracefully close the application, at times this activity is preferable if the target process is frozen, not responding or unable to be shut down any other way (as is the case with certain applications that run in the task-bar).

Parameters

Process

Property

Type

Required

Default

Markup

Description

Find by name

Text

No

(Empty)

  1. PROCESS="NOTEPAD.EXE"

  2. PROCESS="C:\folder\process.exe

If enabled, specifies the name of the process to terminate. This parameter supports the absolute (full) path or relative (file name only) path of the process. If this parameter is enabled, theFind by Process ID parameter becomes inactive. This parameter is enabled by default.

If multiple instances of the process exists, terminate

Text (options)

No

Oldest

  1. SAMEPROCESS="oldest"

  2. SAMEPROCESS="newest"

  3. SAMEPROCESS="nothing"

  4. SAMEPROCESS="all"

Indicates which process instance should be terminated incase more than one instance of a given process is running. The available options are:

  • Oldest (default) - Only the oldest running instance of the process will be terminated.

  • Newest - Only the newest (last) running instance of the process will be terminated.

  • None - No instance of the process will be terminated.

  • All - All instances of the process will be terminated.

Find by process ID

Number

No

Yes

PROCESSID="11452"

If enabled, specifies the process ID of the executable to terminate. If this parameter is enabled, the Find by name  parameter becomes inactive. This parameter is disabled by default.

Note: Use the Processes - Get Information activity to retrieve the process ID of a given process.

Send a "Close" message prior to terminating process

Yes/No

No

No

CLOSEMESSAGE="NO"

If selected, an attempt to close the process gracefully will be performed before terminating it forcibly. If disabled, the application will be forcibly terminated immediately.

Note: If this parameter is disabled, the process will not have opportunity to clean up any system resources it was using before it ends.

Computer

Property

Type

Required

Default

Markup

Description

Local computer

       

If enabled, specifies that the process to end resides on the local machine. This parameter is enabled by default. If this parameter is selected, the Another Computer parameter becomes inactive. This is a visual mode parameter used during design time only, therefore, it contains no markups.

Another computer

     

 

If enabled, specifies that the process to end resides on a remote machine. The parameters below become active if this parameter is enabled. This is a visual mode parameter used during design time only, therefore, it contains no markups.

Computer

Text

Yes

(Empty)

  1. REMOTEMACHINE="machine.domain.com"

  2. REMOTEMACHINE="xxx.xxx.xxx.xxx"

The host name or IP address of the remote machine that contains the process to end. This parameter is available only if the Another computer parameter is enabled.

Domain

Text

Yes

(Empty)

DOMAINNAME="netauto"

The domain name of the remote machine that contains the process to end. This parameter is available only if the Another computer parameter is enabled.

Username

Text

Yes

(Empty)

USERNAME="Bruce.Wayne"

A valid username used to log onto the remote machine that contains the process to end. This parameter is available only if the Another computer  parameter is enabled.

Password

Text

Yes

(Empty)

PASSWORD="batman"

The password corresponding to the username entered in the Username field. This parameter is available only if the Another computer parameter is enabled.

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Example 1

End process Notepad.exe.

Copy
<AMPROCESSES ACTIVITY="end" PROCESSNAME="Notepad.exe" />

Example 2

End all instances of Internet Explorer process.

Copy
<AMPROCESSES ACTIVITY="end" PROCESSNAME="C:\Program Files (x86)\Internet Explorer\iexplore.exe" SAMEPROCESS="all" />