tags:

views:

681

answers:

2

Need to batch a weekly purge of the System queue journal.

A: 
MessageQueue mq = new MessageQueue(".\\Journal$");
mq.Purge();

or

MessageQueue mq = new MessageQueue(".\\myQueue\\Journal$");
mq.Purge();

if its for a queue you created. Make sure the user has the correct permissions. See: http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.aspx

SpaceghostAli
A: 

Answerd here

MessageQueue mq = new MessageQueue("DIRECT=OS:computername\SYSTEM$;JOURNAL");
mq.Purge();
Igal Serban