Tech Nerdery

A Little Batch File Help

I’m writing a batchfile, and I can’t seem to get it to do exactly what I want.

I’m taking a directory of files, and running all the .wav files through LAME and spitting out mp3’s with the correct encoding settings. I’m only writing the batch file because stupid winLame stopped giving me options to control all the bit-rate, and sample frequency settings.

Anyway, here is the stuff:

For %%a in (*.wav) DO lame -m m –cbr -b 32 -s 22.05 –add-id3v2 –tt “%%a” –ta “Jeff Heidkamp” –tl “Mercy Vineyard Church” “%%a” “%%a.mp3”

in this the %%a is the filename, and when I spit out a sermon in mp3 the filename ends up sermonName.wav.mp3 All I really need to know is how to strip the file extension from that variable name.

Anyone ever done something like this…I’m finding batch file programming scarce these days.