Pregunta

I have a command line statement which works perfectly when manually typing it into the console, however, when I put it in a bat file it doesn't work.

for %f in (*.flac) do ffmpeg -i "%f" -acodec alac "%~nf.m4a"

Here is the error message when I try running the bat file

The following usage of the path operator in batch-parameter
substitution is invalid: %~nf.m4a"

Is there any way to fix this? The statement converts flac files to alac files using the program ffmpeg.

¿Fue útil?

Solución

When batch files are interpreted %% is replaced with %, so your solution would be to replace %f with %%f

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top