Applying ReplayGain more easily with Foobar2000 and MP3Tag

I previously wrote about applying ReplayGain to MP3 files with a combination of Foobar2000 and MP3Tag.  I’ve come up with a slightly easier way to reduce some of the manual steps.

I found out that both Foobar2000 and MP3Tag both supports some limited command line operations, and with a tiny bit of legwork, you can add a right-click (context menu) way of making this process easier.

With this approach, you can now right-click songs, select a context menu option and Foobar2000 will automatically apply ReplayGain at the track-level then MP3Tag will automatically open up and add the songs ready for you to apply the custom Action we previously created.

First, make sure you have Foobar2000 and MP3Tag installed.

Second, copy the following script and put it in a batch file and save it somewhere you can remember. I put mine in E:\Documents\ReplayGainScripts\ReplayGain.bat.  I’m on an x64 system, so notice the environment variables highlighted in red which will need to be changed to %PROGRAMFILES% if you are on x86 (32-bit).

@echo off
Echo Sending selected files to Foobar2000 to apply Track-level ReplayGain...
"%PROGRAMFILES(x86)%\foobar2000\foobar2000.exe" /context_command:"Replaygain/Scan per-file track gain" %*
if not %ERRORLEVEL%==0 goto :errorfoobar
Echo Sending direcotry to MP3Tag so you can apply the actions...
"%PROGRAMFILES(x86)%\Mp3tag\mp3tag.exe" /fp:%1
if not %ERRORLEVEL%==0 goto :errormp3tag

echo Foobar2000 exited abnormally, ending script

echo MP3Tag exited abnormally, ending script

After you’ve saved the file, go to %APPDATA%\Microsoft\Windows\SendTo, and create a new shortcut here by right-clicking, selecting New then Shortcut.  For the location, put the path where you saved the batch file.

image Hit Next, then you’ll be prompted to enter a name for the shortcut. I used Apply ReplayGain:


Hit Finish and you’ll be returned back to the explorer Window and you’ll see your newly created shortcut:


You’re done! Now navigate to a directory containing the MP3 files you want to apply ReplayGain to, right click, select Send To then select Apply ReplayGain.  You’ll see Foobar2000 startup, automatically apply track-level ReplayGain, then when you finish, the batch file will start MP3Tag with the files ready for you to apply our ReplayGain action.  (Right-click on the songs, select Convert then Actions…).


  • This was tested on MP3Tag v2.45a and Foobar2000 v0.9.6.9 (which are the latest versions at the time I wrote this).
  • Foobar2000 isn’t designed to be controlled entirely by command line which is why you can’t suppress the UI
  • MP3Tag is extremely limited with only 2 command line options, so the scripts is limited to sending the entire directory to MP3Tag. This means 3 things:
    • Even if you selected a subset of songs from a folder, Foobar2000 will correctly apply ReplayGain only to the subset of songs, but MP3Tag will load all the songs from the folder
    • You can only work on a single folder at time. So do not select songs from multiple folders
    • Currently, there is no way to get MP3Tag to auto-apply the action.
  • I wrote this really quickly so there might be some bugs 🙂


  • Check the batch file output to see if Foobar2000 or MP3Tag are exiting abnormally. Most common causes will be because you’ve specified the wrong path to the EXE’s or you have a copy and paste problem somewhere

If you have any issues, drop me a line in the comments.