End Process Action

Declaration

<AMENDPROCESS FILE="text" SAMEPROCESS="text [options]">

See Also

Run, Close Window, Send Keystrokes

Description

Forcibly ends the running instances) of the process specified. Where possible, it is better to use the "Window Close" action because it notifies the application before actually shutting it down, thus giving the application time to "clean up". Any data entered or changes made in the program that have not been saved, will be lost.

Practical Usage

Used to force a process (usually a program file or EXE) to shut down. Although using the Close Window <AMWINDOWCLOSE> action will gracefully close the application sometimes this action 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

General Tab

File Name

Text, Required
MARKUP:
a) FILE="NOTEPAD.EXE"
b) FILE="C:\WINNT\system32\NOTEPAD.EXE"
c) FILE="C:\WINNT\system32\NOTEPAD.EXE &quot;C:\Program Files\Network Automation\AutoMate 5\readme.txt&quot;"

Specifies the name of the executable to terminate. It may be specified with or without the path.

If more than one matching process found then

Text, Optional - default "FIRST"
MARKUP: SAMEPROCESS="ALL"

Specifies whether the application’s window should be normal, hidden, maximized, or minimized when it starts.

The following text may be used as a value in this parameter (in markup mode, in visual mode radio buttons are provided):

FIRST: Terminate oldest process
LAST
: Terminate newest process
NOTHING
: Do not do anything
ALL
: End all matching processes

Notes

Provided List of running processes

When in visual mode, a list of running process is displayed by clicking the arrow on the dropdown box in the Filename parameter. This is to assist in selecting a valid process.

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMENDPROCESS FILENAME="notepad.exe">

<AMENDPROCESS FILENAME="c:\winnt\notepad.exe" SAMEPROCESS="ALL">