Windows bat file for Foobar Replay Gain & MP3Tag

I did a short crash course. :wink:
The reason why the script does not work with newer versions of Foobar is simply due to a changed context menu parameter for replay gain.
The parameter used to be called "Scan selection as albums (by tags)", today it is only called "Scan as albums (by tags)".
I also changed %1 to "%~1".

Here is the complete modified script:

@echo off
Echo Sending selected files to Foobar2000 to apply Album-level ReplayGain...
"%PROGRAMFILES(x86)%\foobar2000\foobar2000.exe" /context_command:"Replaygain/Scan as albums (by tags)" %*
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
exit
:errorfoobar
echo Foobar2000 exited abnormally, ending script
pause
exit
:errormp3tag
echo MP3Tag exited abnormally, ending script
pause
exit

@GMahal
You should be aware that this script is for album_replaygain. So Foobar only calculates correct scripts if the album-tag is filled already.