我正在尝试使用VBScript计算死信队列中的消息数。 这是我的代码:
Option Explicit
Dim mqQ, QueueName
set mqQ = CreateObject("MSMQ.MSMQManagement")
mqQ.Init "localhost", , "DIRECT=OS:localhost\system$;deadletter"
wscript.echo mqQ.MessageCount & " messsages"
这是我得到的错误:
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.
我使用这种格式来获取私人消息计数,但我在死信中收到此错误。