Is it possible to purge a msmq queue from a bat file?
Essentially I want to make a bat file or at least something quick and easy so that an untrained employee can cl
PowerShell script to purge all private queues on local machine:
[Reflection.Assembly]::LoadWithPartialName("System.Messaging")
$MachineName=(get-wmiobject win32_computersystem).name
[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("$MachineName") | % { $_.Purge(); }
As explained in https://stackoverflow.com/a/11793579/1235394, easiest way to execute it is:
purge-private-msmq-queues.ps1in the same folder create script file purge-private-msmq-queues.cmd with following content:
powershell -executionpolicy Unrestricted .\purge-private-msmq-queues.ps1