ECHO OFF
CLS


Call :_Set_Var

ECHO %xOS%
cd %~dp0
ECHO uninstall_flash_player.exe -uninstall activex
uninstall_flash_player.exe -uninstall activex

ECHO %FileName% -uninstall activex
Start %FileName% -uninstall activex

ECHO copy %VchPath% %FlashPath%
copy %VchPath% %FlashPath%
ECHO copy %OcxPath% %FlashPath%
copy %OcxPath% %FlashPath%
ECHO copy %DllPath% %FlashPath%
copy %DllPath% %FlashPath%
ECHO copy %ExePath% %FlashPath%
copy %ExePath% %FlashPath%
ECHO copy regsvr32 %RegOcxPath%
regsvr32 %RegOcxPath%

rem Pause

:_Set_Var
Set xOS=x86
If Defined PROCESSOR_ARCHITEW6432 (Set xOS=x64) Else If "%PROCESSOR_ARCHITECTURE%"=="AMD64" Set xOS=x64
SET FileName=C:\Windows\System32\Macromed\Flash\FlashUtil_ActiveX.exe
SET RegOcxPath="C:\Windows\System32\Macromed\Flash\Flash32_32_0_0_363.ocx"
SET OcxPath="x86\Flash32_32_0_0_363.ocx"
SET VchPath="x86\activex.vch"
SET DllPath="x86\FlashUtil32_32_0_0_363_ActiveX.dll"
SET ExePath="x86\FlashUtil32_32_0_0_363_ActiveX.exe"
SET FlashPath="C:\Windows\System32\Macromed\Flash\"
IF %xOS%==x86 GoTo :EOF
SET RegOcxPath="C:\Windows\SysWOW64\Macromed\Flash\Flash32_27_0_0_170.ocx"
SET FileName=C:\Windows\SysWOW64\Macromed\Flash\FlashUtil_ActiveX.exe
SET OcxPath="x64\Flash32_27_0_0_170.ocx"
SET VchPath="x64\activex.vch"
SET DllPath="x64\FlashUtil32_27_0_0_170_ActiveX.dll"
SET ExePath="x64\FlashUtil32_27_0_0_170_ActiveX.exe"
SET FlashPath="C:\Windows\SysWOW64\Macromed\Flash\"
GoTo :EOF