2

I'm trying to get a count of the number of messages in the dead-letter queue using VBScript. Here's my code:

 Option Explicit 
 Dim mqQ, QueueName 
 set mqQ = CreateObject("MSMQ.MSMQManagement") 
 mqQ.Init "localhost", , "DIRECT=OS:localhost\system$;deadletter" 
 wscript.echo mqQ.MessageCount & " messsages"

Here's the error I'm getting:

 D:\msmq_queue.vbs(4, 1) MSMQManagement: Operations of the type requested (for example, deleting a queue using a direct format name) are not supported for the format name specified. 

I use this format to grab private message count, but I'm getting this error in dead-letter.

Jeff
  • 688
  • 1
  • 13
  • 30
Ken J
  • 4,312
  • 12
  • 50
  • 86
  • This could be because I can't directly call this queue with MSMQManagement. Any idea how to call the queue with MSMQQueueInfo? – Ken J Sep 15 '12 at 13:08

0 Answers0