Sign in with
Sign up | Sign in
Your question

File Association Command Syntax

Last response: in Windows XP
Share
Anonymous
September 29, 2004 11:01:35 PM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

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
Anonymous
September 30, 2004 11:32:29 AM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

"Pascal Herczog" <dummy@btinternet.com> wrote
| 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.
September 30, 2004 4:52:44 PM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

"anonymouse" <anonymous@discussions.microsoft.com> wrote in message
news:eUAfXvmpEHA.3396@tk2msftngp13.phx.gbl...
>
> "Pascal Herczog" <dummy@btinternet.com> wrote
> | 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.

which will give him <trackname>.mp3.wav


>
> What does ~n mean?
>
> "%1"~n.wav might work.

which will give him <trackname>.mp3~n.wav

>
>

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
Related resources
Anonymous
September 30, 2004 9:48:29 PM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

"george" <anonymous@discussions.microsoft.com> wrote in message
news:exzJ0vtpEHA.3524@TK2MSFTNGP15.phx.gbl...
>
> "anonymouse" <anonymous@discussions.microsoft.com> wrote in message
> news:eUAfXvmpEHA.3396@tk2msftngp13.phx.gbl...
>>
>> "Pascal Herczog" <dummy@btinternet.com> wrote
>> | 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.
>
> which will give him <trackname>.mp3.wav
>
>
>>
>> What does ~n mean?
>>
>> "%1"~n.wav might work.
>
> which will give him <trackname>.mp3~n.wav
>
>>
>>
>
> 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
Anonymous
October 1, 2004 11:05:46 AM

Archived from groups: microsoft.public.windowsxp.customize (More info?)

| >> "Pascal Herczog" <dummy@btinternet.com> wrote
| >> | 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?
!