mIRC Home    About    Download    Register    News    Help

Print Thread
#231816 05/05/11 07:12 PM
Joined: Nov 2003
Posts: 14
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?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #231823 05/05/11 10:09 PM
Joined: Jan 2007
Posts: 1,156
D
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #232191 23/05/11 07:36 PM
Joined: Nov 2003
Posts: 14
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.

Joined: Nov 2003
Posts: 14
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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Nov 2003
Posts: 14
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.

Joined: Nov 2006
Posts: 1,559
H
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

Joined: Nov 2003
Posts: 14
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


Link Copied to Clipboard