End Process Action Icon

End Process

Declaration

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

See Also

Change Printer | Display | Empty Recycle Bin | End Process | Get Process Information | Get Volume Information | Log Event | Print | Registry | Run | Set Date and Time

Processes - End

Declaration

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

See Also

Processes - Create | Processes - Set Affinity | Processes - Set Priority | Processes - Get Info

Description

Forcibly ends the running instance of the process specified.

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 file or EXE) to shut down. Although using the Close Window action will gracefully close the application, at times 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 Properties

Property

Type

Req’d

Default

Markup

Description

Use process name

Text

No

(Empty)

  1. PROCESS="NOTEPAD.EXE"

  2. PROCESS="C:\WINNT\system32\NOTEPAD.EXE"

If enabled, specifies the name of the executable to terminate. It may be specified with or without the path. If this parameter is enabled, the Use process ID parameter is ignored. This parameter is enabled by default.

Use process ID

Text (options)

No

Upper Case

PROCESSID="11452"

If enabled, specifies the process ID of the executable to terminate. If this parameter is enabled, the Use process name parameter is ignored.

Try to send a close message to the application first

Yes/No

No

Yes

CLOSEMESSAGE="NO"

If set to YES (default), a close message will be sent to the application before termination. If set to NO, the application will be terminated immediately.

If more than one matching process found then

Text (options)

No

(Empty)

RESULTVARIABLE="varname"

If more than one matching process is found at runtime, specifies what action to take. The available options are:

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

  • Newest - Only the newest 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.

Process Properties

Property

Type

Req’d

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, the Use Find by Process ID parameter becomes inactive. This parameter is enabled by default.

If multiple instances of the process exist, apply changes to:

Text (options)

No

Upper Case

SAMEPROCESS="nothing"

Indicates which process instance should be terminated in case 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

Text

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 is ignored. This parameter is disabled by default.

Send a "Close" message prior to terminating process

Yes/No

No

No

CLOSEMESSAGE="NO"

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

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

Computer Properties

Property

Type

Req’d

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 on, therefore, it contains no markups.

Another computer

---

---

---

---

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

Machine Name

Text

Yes

(Empty)

  1. REMOTEMACHINE="machine.domain.com"

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

The host name or IP address of the remote machine in which  to retrieve process information from. This parameter is available only if the Another Computer parameter is enabled.

Machine Domain

Text

No

(Empty)

DOMAINNAME="netauto"

The domain name of the remote machine to get process information from. This parameter is available only if the Another Computer parameter is enabled.

Username

Text

No

(Empty)

USERNAME="Bruce.Wayne"

A valid user name used to log onto the remote machine in which to get process information from. This parameter is available only if the Another Computer  parameter is enabled.

Password

Text

No

(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 Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes properties

On Error Properties

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

Additional 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.

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.

 

Sample 1 - End process Notepad.exe.

 

<AMENDPROCESS PROCESS="Notepad.exe" />

 

 

Sample 2 - End all instances of Internet Explorer process.

 

<AMENDPROCESS PROCESS="C:\Program Files (x86)\Internet Explorer\iexplore.exe" SAMEPROCESS="all" />

 

↑ Top