drum you are correct about what I mean about a single instance of mirc running.

I still believe a built in method would be best but Chessnut has posted something that seems like the best alternative. I have a little alias that returns if a given program is running, but the way it's made isn't helpful since it just gives true or false. However that code above is quite perfect since it can check if the current mirc exe is being ran twice. Thanks Chessnut

p.s. i only ever run 1 mirc exe with 1 mirc.ini so i don't have to bother checking anything more than if the mirc exe is already running.

edit:
posting the final script, which is 99% Chessnut's and 1% on start event ^_^

Code:
on *:start: if ($numMirc > 1) exit

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 ExecutablePath = $qt($replace($mircexe,\,\\)) $&
    ,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
}

Last edited by pball; 11/04/11 04:14 PM.

http://scripting.pball.win
My personal site with some scripts I've released.