Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Windows CMD. Batch Process Extension Problem

Options
  • 12-02-2014 2:01pm
    #1
    Registered Users 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 Posts: 4,766 ✭✭✭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 Posts: 28 agriva8


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


Advertisement