File Association Command Syntax

P

Pascal Herczog

I would like to add a right mouse click option on my MP3 files to decode
them to WAV files, by adding the following command to the MP3 file type
association (from the Explorer -> Folder Options -> File Types):

"....Lame.exe" --decode "%1" "%~n1".wav

I've used the syntax for batch files to describe what I want, which is to
define the output file name as being the input file name without the .mp3
extension, since Lame automatically appends .wav to whatever input file name
is given if you don't specify the output name. (So I'd end up with
<name>.mp3.wav as the output if I only specify "%1"

Of course, I can't get the above syntax to work for commands associated with
file types. Is there any description of what syntax is usable, or will I
have to reference a batch file to do this for me?

Thanks,
Pascal
 
A

anonymouse

| I would like to add a right mouse click option on my MP3 files to decode
| them to WAV files, by adding the following command to the MP3 file type
| association (from the Explorer -> Folder Options -> File Types):
|
| "....Lame.exe" --decode "%1" "%~n1".wav
|
| I've used the syntax for batch files to describe what I want, which is to
| define the output file name as being the input file name without the .mp3
| extension, since Lame automatically appends .wav to whatever input file name
| is given if you don't specify the output name. (So I'd end up with
| <name>.mp3.wav as the output if I only specify "%1"
|
| Of course, I can't get the above syntax to work for commands associated with
| file types. Is there any description of what syntax is usable, or will I
| have to reference a batch file to do this for me?
|
| Thanks,
| Pascal


"%~n1".wav is nonsense.

"%1".wav might work.

What does ~n mean?

"%1"~n.wav might work.
 
G

george

anonymouse said:
| I would like to add a right mouse click option on my MP3 files to decode
| them to WAV files, by adding the following command to the MP3 file type
| association (from the Explorer -> Folder Options -> File Types):
|
| "....Lame.exe" --decode "%1" "%~n1".wav
|
| I've used the syntax for batch files to describe what I want, which is
to
| define the output file name as being the input file name without the
.mp3
| extension, since Lame automatically appends .wav to whatever input file
name
| is given if you don't specify the output name. (So I'd end up with
| <name>.mp3.wav as the output if I only specify "%1"
|
| Of course, I can't get the above syntax to work for commands associated
with
| file types. Is there any description of what syntax is usable, or will I
| have to reference a batch file to do this for me?
|
| Thanks,
| Pascal


"%~n1".wav is nonsense.

"%1".wav might work.


What does ~n mean?

"%1"~n.wav might work.


which I don't think is what he was trying to achieve.

The way I read his Q. is that he wants to 'input' <trackname>.mp3 (being %1)
and have it 'output' as <trackname>.wav straight away.
Apparently (way I read it) somehow in his batchfile-solution the ~n does
something special to the filename on output.
I might be wrong, but if I'm not, I too would be interested to hear what's
up with this ~n thing.

george
 
P

Pascal Herczog

george said:
which I don't think is what he was trying to achieve.

The way I read his Q. is that he wants to 'input' <trackname>.mp3 (being
%1) and have it 'output' as <trackname>.wav straight away.
Apparently (way I read it) somehow in his batchfile-solution the ~n does
something special to the filename on output.
I might be wrong, but if I'm not, I too would be interested to hear what's
up with this ~n thing.

Sorry for not replying sooner, but I can't get to newsgroups during the day.

I can assure you that the syntax of %~n1" is valid, where ~n is one of
several possible modifiers to the first input parameter and so on, meaning
that it strips the extension part from the input name. At least, this is the
case in dos batch files on winxp. And my original line does work in batch
files. What I can't seem to find is a reference to the allowable syntax in
the command entry for file associations. Most times, of course, only "%1" is
adequate, but not in this case if I want to execute the 'lame' command
directly instead of via a batch file.

If you have any pointers to the valid syntax options for this command line
on file associations, or indeed, whether I might be able to use the DDE
entry instead (I've no idea what that does!), then I'd be most grateful!

Thanks,
Pascal
 
A

anonymouse

| >> | I would like to add a right mouse click option on my MP3 files to
| >> | decode them to WAV files, by adding the following command to the MP3 file type
| >> | association (from the Explorer -> Folder Options -> File Types):
| >> |
| >> | "....Lame.exe" --decode "%1" "%~n1".wav
| >> |
| >> | I've used the syntax for batch files to describe what I want, which is
| >> | to define the output file name as being the input file name without the
| >> | .mp3 extension, since Lame automatically appends .wav to whatever input file
| >> | name is given if you don't specify the output name. (So I'd end up with
| >> | <name>.mp3.wav as the output if I only specify "%1"
| >> |
| >> | Of course, I can't get the above syntax to work for commands associated
| >> | with file types. Is there any description of what syntax is usable, or will
| >> | I have to reference a batch file to do this for me?

| >> "%~n1".wav is nonsense.
| >> "%1".wav might work.
| >> What does ~n mean?
| >> "%1"~n.wav might work.

| Sorry for not replying sooner, but I can't get to newsgroups during the day.
|
| I can assure you that the syntax of %~n1" is valid, where ~n is one of
| several possible modifiers to the first input parameter and so on, meaning
| that it strips the extension part from the input name. At least, this is the
| case in dos batch files on winxp. And my original line does work in batch
| files. What I can't seem to find is a reference to the allowable syntax in
| the command entry for file associations. Most times, of course, only "%1" is
| adequate, but not in this case if I want to execute the 'lame' command
| directly instead of via a batch file.
|
| If you have any pointers to the valid syntax options for this command line
| on file associations, or indeed, whether I might be able to use the DDE
| entry instead (I've no idea what that does!), then I'd be most grateful!
|
| Thanks,
| Pascal


"file associations" not equal to "batch file"

"%1" is an expandable string whose value is the file which you double-clicked.

I have never seen ~n used in a batch file.

If you mean that %~n1 is a valid command-line parameter for Lame.exe then
"....Lame.exe" --decode "%1" "\%~n1".wav might work.

What is the exact command-line syntax for Lame.exe?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top