I want to associate a extension to a program by a batch file.
This command works fine when I write it interactively.
ftype wavfile="%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe" "%1"
But when I write it in a batch file and run, then %1 are recognized as a variable, so it ends up with:
ftype wavfile="%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe" ""
I think someone already ask a same question, but I couldn't find it. How can I use %1 or some other argument variables in a batch file?
Answer
You should use two percentage symbols like this: %%1, which will work for a batch file.
It will escape the %% into a percent sign.
No comments:
Post a Comment