mIRC Homepage
Posted By: Voglea Command line options - 28/11/10 11:08 AM
mirc.exe -a /alias [parameters] - execute alias
mirc.exe -s signal [parameters] - sent signal to mirc

(update message)
for what? just i want execute some command from external programs, like uTorrent.

Posted By: FroggieDaFrog Re: Command line options - 28/11/10 11:45 AM
write a simple .bat file
Code:
@echo off
echo %1 >> path\file.txt

then, from utorrent use: "path-to-file" "%n"

and THEN have mIRC poll path\file.txt
Posted By: m0viefreak Re: Command line options - 28/11/10 05:56 PM
i wrote a small program for that years ago in delphi:

Code:
program mirccmd;

uses
  ddeman;

{$R *.res}


var
  DDE: TDDEClientConv;
  i:Integer;
  parameters:String;
begin
  try
    for i := 1 to paramcount do begin
      parameters := parameters + ' ' + ParamStr(i);
    end;
    DDE := TDDEClientConv.Create(nil);
    DDE.SetLink('mirc', 'COMMAND');
    DDE.OpenLink;
    DDE.PokeData('COMMAND',Pchar(parameters));
  except
  end;

end.


It simply sends the command line arguments to mirc's DCC server (server name is hardcoded as mirc's default dde name 'mirc').

Notice: include the starting / when passing commands. Example:

Code:
mirccmd.exe /echo -a test


Download:
Code:
http://www57.zippyshare.com/v/50510393/file.html
Posted By: Wims Re: Command line options - 28/11/10 06:16 PM
The command line is here to tell to mirc how to behave before the application start, what you're asking is completely not needed, use the on start event to run your alias and to send your signal

after reading argv0's post, it seems you don't want the application to really run, which isn't mentioned in your suggestion.
Posted By: argv0 Re: Command line options - 28/11/10 07:07 PM
I like this, but I see some problems with it:

1) The behaviour to me would seem like it would spawn a new instance of mIRC. The only feasible thing to do here would be to have mIRC talk to an already running instance to pass the command. In this sense, it should function like DDE, however...

2) This would be problematic if you were running multiple instances of mIRC, since it would be impossible to tell which process to talk to. mIRC works by having the process listen to a DDE service name (defaulting to "mIRC"), which is what mIRC could contact, but...

3) If the DDE service name changes from mIRC to something else, mIRC would not be able to know what it is. In this case, it might be necessary to supply the DDE service name in the command line. I wouldn't have a problem with this.

In short, mIRC should have a command-line switch that acts as a tiny helper method to send a DDE requests to a DDE service (defaulting to mIRC). I suppose it could look like:

mirc.exe -d [SERVICENAME] "command to execute"

Although for parsing simplicity, having a separate switch for the service name might be wise:

mirc.exe -s SERVICENAME -d "command to execute"

Calling mIRC in this way wouldn't actually spawn the client, it would simply send a DDE message and exit, without showing any UI elements-- it would basically be the delphi code shown above.

The only problem I see with having such a functionality in mIRC is that it lends itself for more piggyback abuse from viruses, which could use this command to send DDE messages to arbitrary services (like your browser). I'm not sure how big a deal this is, though, if a virus is already running in memory.
© mIRC Discussion Forums