MSMQ - Delete Queue


<AMMSMQ ACTION="delete" QUEUENAME="text" />

See Also

MSMQ - Create Queue | MSMQ - Retrieve Message | MSMQ - Send Message | MSMQ - Wait for Message | MSMQ - Clear Queue


Deletes the specified message queue located locally or on a remote machine.

IMPORTANT: MSMQ must be installed on the (local or remote) system in order for these activities to function properly. MSMQ is bundled with Microsoft Windows 2000, Windows XP (excluding Home Edition), Windows Server 2003, Windows Vista and Windows 7 operating systems, however, they are not installed by default. For more details regarding the installation of MSMQ, see MSMQ Installation & Overview.

Practical Usage

Deletes a message queue, usually after completing the desired MSMQ transactions.


General Properties







Local Machine





If enabled, specifies that this activity will be performed on the local machine. If this parameter is selected, the Remote Machine parameter is ignored. This parameter is enabled by default.

Remote Machine





If enabled, specifies the host name or IP address of the remote machine that this activity will be performed on. If this parameter is enabled, the Local Machine parameter is ignored.

Message Queue





The name of the message queue to delete. The message queue name consists of the compute name, an optional PRIVATE$ keyword that indicates whether it is a private queue and the name of the queue.

Public queue example: ComputerName\QueueName

Private queue example: ComputerName\PRIVATE$\QueueName


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

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (Example: %myVariable% or %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert expression/variable button or pressing F2.

More on variables
More on expressions

More on the Expression Builder


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


Description: This sample code delete's the queue "VMWINVX64\private$\myQueue" located on the local machine".


<AMMSMQ ACTION="delete" QUEUENAME="VMWINVX64\private$\myQueue" />


↑ Top of Page