If you are in an environment that has multiple versions of Flash Player, I would recommend using Adobe’s Uninstall Flash Player tool in your Flash Player install script. You can download the uninstall tool here.

Using the following line will uninstall any version of Flash Player that was installed on the computer.

uninstall_flash_player.exe -uninstall

Below is an example script that uninstalls and installs the latest version of Flash Player.

REM Setting Current Directory
cd "%~dp0"

REM Uninstalling Flash
uninstall_flash_player.exe -uninstall

REM Installing Flash
msiexec /i "install_flash_player_21_active_x.msi" /qn /norestart /log "C:\Temp\flashinstall.log" 


IF %ERRORLEVEL% == 0 goto MMS
exit %ERRORLEVEL%

:MMS
REM Copying SilentAutoUpdate Config
IF EXIST %WINDIR%\SysWow64\Macromed\Flash (
    copy /Y mms.cfg %WINDIR%\SysWow64\Macromed\Flash
	copy /Y mms.cfg %WINDIR%\System32\Macromed\Flash
	
) ELSE (
    copy /Y mms.cfg %WINDIR%\System32\Macromed\Flash
)