COM Objects

From Scriptwiki
(Redirected from Comreg)
Jump to: navigation, search

mIRC allows you to call COM objects via scripts. You must have experience with COM objects in order to use this feature.


This opens a COM connection to object progid eg. Excel.Application, and assigns the connection a name.

/comopen name progid

$comerr should be checked after a call to any COM command or identifier. Returns 1 if there was an error, 0 otherwise.


Use /comclose to close the COM connection.

/comclose name


Use /comlist to list all open COM connections.



/comreg -u filename

This registers/unregisters a COM DLL with windows.


alias comRegister {
  comopen name progid

  ; if comopen failed, maybe the DLL that came with the script is not registered
  if ($comerr) {

    ;register the DLL
    comreg test.dll

    ;try to open it again
    comopen name progid

    ; still failed, halt the script
    if ($comerr) halt