Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9183487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:48:54+00:00 2026-06-17T18:48:54+00:00

I need to get working properly a tiny Windows batch file (convert.cmd) that changes

  • 0

I need to get working properly a tiny Windows batch file (convert.cmd) that changes bitrate of all MP3 files in a specified folder. I need to pass 2 parameters to the batch file:

  • the path to the folder with MP3 files
  • bitrate I want to change them to.

I am using Lame.exe encoder. The lame.exe is in one place, convert.cmd can be in the same folder with lame.exe, but the folder with MP3 files can be anywhere. The original version (without parameters) was (and it’s working fine if I place convert.cmd in the folder wit MP3 files):

@ECHO OFF
FOR %%f IN (*.mp3) DO (
    D:\Apps\Lame\lame.exe -h -b 128 "%%f" "%%f.temp"
    DEL "%%f"
    REN "%%f.temp" "%%f"
)
PAUSE

Instead of 128 I need to pass “%2” and it will be a second command-line parameter, the bitrate, and for MP3 files folder path I need to pass “%1”. So, I got this, but it’s not working.

@ECHO OFF
FOR %%f IN (%1\*.mp3) DO (
    D:\Apps\Lame\lame.exe -h -b %2 "%%f" "%%f.temp"
    DEL "%%f"
    REN "%%f.temp" "%%f"
)
PAUSE

How to make it work as described?

How can I ensure that my batch file convert existing files, and not creating new converted copies of them somewhere? Thanks a bunch 😉 Cheers.

UPDATE

The location of convert.cmd is:

d:\Apps\Lame\convert.cmd, same folder with lame.exe

The location of MP3 files is:

d:\temp\xxx\

  • File1.mp3
  • File2.mp3

When I execute convert.cmd from the command line like this:

convert.cmd d:\temp\xxx\ 64

what I get in d:\temp\xxx\ is this:

  • File1.mp3.temp
  • File2.mp3.temp

Where did the converted files go?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:48:55+00:00Added an answer on June 17, 2026 at 6:48 pm

    Thanks, I have already figured out how to write this script.

    If someone needs this type of conversion, here we go:
    1 param – full path to the folder with mp3 files
    2 param – bitrate to convert to

    (remember, lame.exe does not preserve mp3 tags)
    p.s. who needs mp3 tags anyways ? 🙂

    @ECHO OFF
    ECHO.
    ECHO BEGIN CONVERSION
    ECHO.
    CD %1
    DIR *.mp3
    ECHO -------------------------------------------------------------------------------
    ECHO THESE MP3 FILES WILL BE CONVERTED TO BITRATE %2 KBPS
    ECHO -------------------------------------------------------------------------------
    PAUSE
    FOR %%f IN (*.mp3) DO (
        ECHO -------------------------------------------------------------------------------
        ECHO CONVERTING: %%f
        ECHO -------------------------------------------------------------------------------
        D:\Apps\Lame\lame.exe -h -b %2 "%%f" "%%~nf.wav"
        DEL "%%f"
        REN "%%~nf.wav" "%%f"
    )
    ECHO.
    ECHO END CONVERSION
    ECHO.
    PAUSE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working in a project that need to get SVD (Single Values Decomposition) for
I am currently working with a file name and I need to get the
I'm working on some ECMAScript/JavaScript for an SVG file and need to get the
Need a hand trying to get my rotating banner working properly on my website.
trying to make a .bat script, and need to get some strings working properly.
I need a little help to get my side nav working properly. Link to
I'm doing some experimenting with HttpWebRequest, and need to get it working with SSL.
I need to get the free Google charts working over SSL without any security
i am working on a magento project and i need to get the value
I'm working on a web app and I need to get a div to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.