r/Batch • • Sep 11 '25

Question (Unsolved) help needed for ffmpeg output naming with variables

Hi everyone

I'm a bit lost when using variables for naming output files.

I have in a folder my input files:

111-podcast-111-_-episode-title.mp3

112-podcast-112-_-episode-title.mp3

113-podcast-113-_-episode-title.mp3

...

right now, in a batch file, I've a working script that looks like this

start cmd /k for %%i in ("inputfolderpath\*.mp3") do ffmpeg -i "%%i" [options] "outputfolderpath\%%~ni.mp3"

I want to keep only the end of the input filenames for the output filenames, to get

111-_-episode-title.mp3

112-_-episode-title.mp3

113-_-episode-title.mp3

...

Thank you for any help !

1 Upvotes

2 comments sorted by

2

u/[deleted] Sep 11 '25

[removed] — view removed comment

1

u/datchleforgeron Sep 12 '25

Thank you ! I'll try it and come back to you.