Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Both public and local private queues can be deleted by a single call to MSMQQueueInfo.Delete.

Note:
Deleting the queue does not delete the MSMQQueueInfoobject, only the existing reference to the queue in the directory service (for public queues) or the local computer (for private queues). Because the MSMQQueueInfoobject still exists, you can still create a new queue based on its current properties.
To delete a queue
  1. Declare the objects needed to obtain the MSMQQueueInfoobject.

  2. Obtain the MSMQQueueInfoobject of the queues you want to delete.

  3. Call MSMQQueueInfo.Deleteto delete the queue.

See Also