More > JRiver Media Center 20 for Windows

MC20.exe --- trying to rename it...

<< < (3/5) > >>

BabyFace:

--- Quote from: AUser on August 23, 2014, 10:10:53 am ---Either you're doing something wrong or you've found a problem that nobody else has - commas work fine
Unless explorer isn't quoting a filename for instance, tbh the easiest way to get explorer to quote everything is to have a space in the filename or path

Quotes and %~1 (to unquote) are your friends with parameters
Exclamation points (in FOR expansion) and the ampersand character can be tricky though

--- End quote ---


Write a quick DOS batch file and pass A,B as an arg, then see what you have.  You would expect %1 to be A,B.

but no... %1 is A and %2 is B.

If you pass it quoted "A,B" then %1 is A,B

AUser:
Actually I would expect %1=a and %2=b as that's the documented behaviour (also for semicolons as well as commas)
Sucks, but that's the rules
Quote your params and unquote when needed

glynor:

--- Quote from: DoubtingThomas on August 23, 2014, 10:26:09 am ---
Write a quick DOS batch file and pass A,B as an arg, then see what you have.  You would expect %1 to be A,B.

but no... %1 is A and %2 is B.

If you pass it quoted "A,B" then %1 is A,B

--- End quote ---

Yes, that behavior is exactly as expected. Your expectations are incorrect.

BabyFace:
Passing a command to a dos batch file like this does not work

MCXX.bat /mcc 12345,6

this does

MCXX.bat /mcc "12345,6"

but when I try to call that batch file from a C++ program using system() it doesn't work for unknown reasons.

So I gave up and wrote a C++ wrapper pgm for MCxx.exe which gets the version number from a config file to know what MCxx.exe to call.  I might have it take a look at the process list to determine which MCxx.exe to call instead of using the config file.

BryanC:
Can't you just make a
--- Code: ---MC20.exe /mcc $1
--- End code ---
MCXX.bat file and call it using MCXX.bat "command"?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version