Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Windows CMD. Batch Process Extension Problem

  • 12-02-2014 01:01PM
    #1
    Registered Users, Registered Users 2 Posts: 345 ✭✭


    Hey Guys,

    I've having a nervous breakdown trying to figure a way of doing this and I'm now exhaused!

    I've a file full of WAV files, and a little .exe that'll convert them to MP3 for me.
    The file names are a variable and the batch will run every few hours - turning any WAVS found into MP3s.

    The problem I'm having is once the WAV is converted it keep's it .wav

    Here's what I've been using to grab the filename and convert it.
    @echo off
    for %%a in (*.wav) do (
    Coreconverter.exe -infile="%%a" -outfile="%%a" -convert_to="mp3 (Lame)" -V 6 
    )
    

    Anyway to change the extension afterwards?


Comments

  • Registered Users, Registered Users 2 Posts: 4,846 ✭✭✭cython


    Hey Guys,

    I've having a nervous breakdown trying to figure a way of doing this and I'm now exhaused!

    I've a file full of WAV files, and a little .exe that'll convert them to MP3 for me.
    The file names are a variable and the batch will run every few hours - turning any WAVS found into MP3s.

    The problem I'm having is once the WAV is converted it keep's it .wav

    Here's what I've been using to grab the filename and convert it.
    @echo off
    for %%a in (*.wav) do (
    Coreconverter.exe -infile="%%a" -outfile="%%a" -convert_to="mp3 (Lame)" -V 6 
    )
    

    Anyway to change the extension afterwards?



    As per http://stackoverflow.com/questions/3215501/batch-remove-file-extension have you tried something like
    @echo off
    for %%a in (*.wav) do (
    Coreconverter.exe -infile="%%a" -outfile="%%a" -convert_to="mp3 (Lame)" -V 6 
    rename %%a %%~na.mp3
    )
    

    %%~na should extract the name before the extension, so you can just rename similar to the above.


  • Registered Users, Registered Users 2 Posts: 28 agriva8


    Does -outfile="%%a.mp3" work? (OK, it end up as mysong.wav.mp3)


Advertisement