mIRC Homepage
Posted By: Compudoc DCC command issue - 05/05/11 07:12 PM
After downloading a music file from someone via DCC, I want to be able to use the following command to have Winamp play the file once it is downloaded:

"C:\Program Files (x86)\winamp.exe" /Add "\\QUEUE" "%1"

After the file is downloaded, I see the following error message:

C:\PROGRAM Unknown command

I have also used the variable with the % signs instead of the directory without success.

Anyone have any suggestions?
Posted By: Riamus2 Re: DCC command issue - 05/05/11 08:21 PM
Try:

//run $qt(C:\Program Files (x86)\winamp.exe) /Add "\\QUEUE" "%1"

I can't test it right now, but $qt() puts quotes around the path to avoid that issue.
Posted By: Wims Re: DCC command issue - 05/05/11 09:02 PM
The problem isn't space in the path, he is executing the command called C:\program, the server just reports the command is unknown (raw 421)
Posted By: DJ_Sol Re: DCC command issue - 05/05/11 10:09 PM
So wouldn't quotes fix that issue? My issue was with mdx dll. If I had a space in my file path to the dll I would get an error like his.

"C:\\Documents" no file (or whatever the error is) because the path was C:\\Documents and Settings\etc.

So once I surrounded the path that had spaces with quotes, it worked right.
Posted By: Wims Re: DCC command issue - 05/05/11 11:35 PM
No, his error message is clear, when a command isn't an internal one or a custom alias, it is sent to the server, he is sending
Quote:
C:\PROGRAM
to the server, adding quotes would just results in
Quote:
"C:\PROGRAM" unknown command
he needs to use /run as suggested
Posted By: Compudoc Re: DCC command issue - 23/05/11 07:36 PM
But Wims - that would mean, to me, that mIRC is not interpreting the FULL PATH correctly (C:\Program Files(X86) etc.)
The error message STOPS with the space AFTER the word program which, to me, means that mIRC CANNOT interpret spaces in a path correctly as of now.
Posted By: Compudoc Re: DCC command issue - 23/05/11 07:54 PM
I also believe there to be another issue:

When I tried to insert the command specified above, the command box cut things off on the last "e' for "winamp.exe". My feeling is there is a limit to the length of the command (i.e. the box to insert the command into has a defined length - probably 80 characters).
Also, would $qt have to be used around each "piece" of this command?
This is not a "show-stopper". I am just testing an interface that seems to be balky between mIRC and Winamp.
Posted By: Riamus2 Re: DCC command issue - 23/05/11 10:04 PM
You should only need $qt() around the path/filename. For mIRC to know that your path/filename has spaces in it and that it's not a new piece of information (aka parameter) for the command, quotes need to be used. That's what $qt() does. The parameters should not need quotes.

The only limit you should see on a command like //run is the Windows maximum path length, which used to be 256 characters, but I am pretty sure it's been bumped up a lot since XP. Most other commands have around a 4000 character limit in mIRC.

If it is cutting something off, then there may be some error in your script. If you show the full script that you are using for the part that is getting cut off, someone can tell you where the problem is.
Posted By: Compudoc Re: DCC command issue - 30/05/11 05:47 PM
Here is the command line I am using:

"C:\Program Files (x86)\winamp.exe" /Add "\\QUEUE" "%1"

As stated, it is CUTTING OFF the command after the Word "Program" saying it is an unknown command.

My BELIEF is that it is a problem in interpreting the command due to long file names/directories.

Thank you for your assistance/indulgence in this matter.
Posted By: Horstl Re: DCC command issue - 30/05/11 09:53 PM
As Wims pointed out, this cannot work without the /run command.

Originally Posted By: /help /run
/run [-np] <filename> [parameters]

runs the specified program with parameters.

thus

/run "C:\Program Files (x86)\winamp.exe" /Add "\\QUEUE" "%1"

tells mIRC to run the file winamp.exe located at C:\Program Files (x86)\, with your parameters aka winamp command line options.
As <filename> is a filepath-with spaces, you have to put it in quotation marks, (Riamus2 stressed that point). mIRC would else take " C:\Program" " as <filename> and the whole " Files (x86)\winamp.exe" /Add "\\QUEUE" "%1" " as [parameters].

I don't use winamp, but I doubt you need quotation marks arround the command line parameter "\\Queue". Also note that mIRC will not evaluate the variable %1 to it's value if put in quotation marks. If the value of %1 has to be in quotation marks according to winamp command line options, use either $qt(%1) or $+(",%1,").



Just to make it clear, if you omit the /run command, you're telling mIRC to execute a command (internal command or scripted alias) called " "C:\Program " and with the parameters " Files (x86)\winamp.exe" /Add "\\QUEUE" "%1" ".

"C:\Program Files (x86)\winamp.exe" /Add "\\QUEUE" "%1"

As mIRC does not find such a command it sends the whole line to the server - just like any unknown command.
The server, in return, does not know the command either. He's thus returning an error message (raw 421) about the unknown command (wherein the additional parameters are left out), and mIRC does display the server's error message:
Quote:
"C:\Program Unknown command
Posted By: Compudoc Re: DCC command issue - 02/06/11 12:06 PM
Wilms and Horstl - Thank you for the feedback. Please forgive me both of you if I seemed frustrated in my words in this thread.
I guess the person helping ME assumed that when the command was book in that box that a /run command would be used w/o having to specify it. Now that you have put in your input, Horstl, I realize that assumption was bad.
The "%1" is a parameter being passed - in this case, a file name. I will try it with the quotes and with $sqt.
I appreciate the help with this issue. I will post back when I do more testing.
Lou
© mIRC Discussion Forums