Batch File Using Long Filenames

I am trying to write a batch file, which extracts the audio portion of a video file. It later analyses the audio MP3 to 'normalize' it. The first command is as follows:

ffmpeg -i "%1" -vn -ar 48000 -ac 2 -ab 128k -f mp3 "%~n1".mp3

The batch file works fine except when it is used on a video with a filename that contains more than one word and blank spaces. As an example, the command 'batchfile.bat Video.avi' works while 'batchfile.bat Video One.avi' does not.

I've tried a bunch of adjudtments with no luck. Anyone know how I can call a long filename?

Thanks...John
2 answers Last reply
More about batch file long filenames
  1. I think in that case the filename would have to be completely encapsulated in quotes.
  2. +1^
Ask a new question

Read More

Windows XP Audio Video MP3 Command Prompt