mIRC Home    About    Download    Register    News    Help

Print Thread
DCC command issue #231816 05/05/11 07:12 PM
Joined: Nov 2003
Posts: 14
Compudoc Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2003
Posts: 14
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?

Re: DCC command issue [Re: Compudoc] #231818 05/05/11 08:21 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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.


Invision Support
#Invision on irc.irchighway.net
Re: DCC command issue [Re: Riamus2] #231821 05/05/11 09:02 PM
Joined: Jul 2006
Posts: 3,615
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,615
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)


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: DCC command issue [Re: Wims] #231823 05/05/11 10:09 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
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.

Re: DCC command issue [Re: DJ_Sol] #231825 05/05/11 11:35 PM
Joined: Jul 2006
Posts: 3,615
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,615
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


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: DCC command issue [Re: Wims] #232191 23/05/11 07:36 PM
Joined: Nov 2003
Posts: 14
Compudoc Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2003
Posts: 14
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.

Re: DCC command issue [Re: Riamus2] #232195 23/05/11 07:54 PM
Joined: Nov 2003
Posts: 14
Compudoc Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2003
Posts: 14
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.

Re: DCC command issue [Re: Compudoc] #232205 23/05/11 10:04 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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.


Invision Support
#Invision on irc.irchighway.net
Re: DCC command issue [Re: Riamus2] #232333 30/05/11 05:47 PM
Joined: Nov 2003
Posts: 14
Compudoc Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2003
Posts: 14
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.

Re: DCC command issue [Re: Compudoc] #232337 30/05/11 09:53 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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

Re: DCC command issue [Re: Horstl] #232391 02/06/11 12:06 PM
Joined: Nov 2003
Posts: 14
Compudoc Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Nov 2003
Posts: 14
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