This works if you use a symlink in your path (e.g. environment variable M2 points to C:\maven\bin; and C:\maven is a symlink pointing to C:\Program Files\Apache\apache-maven-x.x.x), such that you can delete the symlink or NTFS junction in the middle of the script, and recreate it to another version of Maven. Example of how I changed this:
cd C:\
rmdir maven
mklink /j maven "%APACHE%\apache-maven-3.2.1"
start /wait cmd /q /c rebuildCore.bat
cd C:\
rmdir maven
mklink /j maven "%APACHE%\apache-maven-2.2.1"
start /wait cmd /q /c rebuildApp
:: THIS LAST LINE EXTRACTS MY RCP APP FROM THE BUILT ZIP FILE TO A FOLDER ON MY DESKTOP
7z x "C:\Users\USER\workspace\app-win32-std-product\target\app-win32-std-product-2.4-SNAPSHOT.zip" -oC:\Users\USER\Desktop\ *.* -r -y