A better workaround that doesn't involve creating a special file or something like that is:

Code:
alias numMirc {
  .comopen numMirc1 WbemScripting.SWbemLocator
  if ($com(numMirc1)) .comclose numMirc1 $com(numMirc1,ConnectServer,3,dispatch* numMirc2)
  if ($com(numMirc2)) .comclose numMirc2 $com(numMirc2,ExecQuery,3,bstr, $& 
    SELECT * FROM Win32_Process WHERE Name = "mirc.exe" $&
    ,dispatch* numMirc3)
  if ($com(numMirc3)) {
    var %total $comval(numMirc3,0)
    .comclose numMirc3
    return %total
  }

  :error
  if ($com(numMirc1)) .comclose numMirc1
  if ($com(numMirc2)) .comclose numMirc2
  if ($com(numMirc3)) .comclose numMirc3
  return -1
}


I'm not sure what you mean by "running from the same settings". If you meant that you wanted to return only the number of mIRCs running that use the same .exe, change:

Quote:
SELECT * FROM Win32_Process WHERE Name = "mirc.exe"


to

Quote:
SELECT * FROM Win32_Process WHERE ExecutablePath = $qt($replace($mircexe,\,\\))


I agree that this would be a nice feature to have implemented anyway, but the above script should work just as well!

Last edited by Chessnut; 11/04/11 03:38 AM.