Flash downgrade script – Group Policy

Since Adobe is no longer going to be supporting Flash Player after December 31, 2020 lots of companies who still need flash have no option but to downgrade flash and prevent flash from auto-updating. Microsoft is also going to drop updates globally to uninstall the embedded flash from Win 10 and Win 8.1. So for all of those who want to retain a specific version of flash the below code will be helpful. You can deploy it via GPO.

Script Summary

1. Checks windows OS version Win7/Win8.1/Win10
2. Checks if the machine is a 32 / 64 bit  and installs the required package.
3. Checks if the flash version 31.0.0.118 (If present skips execution)
4. Copies mms.cfg file (To block autoupdate)

The code calls for files that have to be placed in the SYSVOL scripts folder. For my scenario, I am downgrading/upgrading the existing flash version to v31 and copying the mms.cfg files. The files I am using for this script are available in the below button link.

NOTE: make sure you copy the “Adobe” folder to your SYSVOL location and the script to the startup script folder.

Disclaimer: Use at your risk and always test the script in your environment before deploying into production.

::----------------------------------------------------------------------------------------------------------
:: Author:Nivi Kolatte
:: Version 1.1
:: 26/12/2020 - Added x86 support added
:: Script is part of a GPO deployment to downgrade Adobe Flash activeX on Win 10 , Win 7 , Win 8.1
::----------------------------------------------------------------------------------------------------------

@echo off

REM Checking Windows OS version

ver | find "6.1"
IF ERRORLEVEL = 1 goto next1
IF ERRORLEVEL = 0 goto win7
 
:next1
ver | find "6.2" > nul
IF ERRORLEVEL = 1 goto next2
IF ERRORLEVEL = 0 goto win10
 
:next2
ver | find "6.3" > nul
IF ERRORLEVEL = 1 goto next3
IF ERRORLEVEL = 0 goto win10
 
:next3
ver | find "10.0" > nul
IF ERRORLEVEL = 1 goto other
IF ERRORLEVEL = 0 goto win10


::----------------------------------------------------------------------------------------------------------

:win7
REM Checking if the Flash 31 is installed in x64
IF EXIST "C:\Windows\SysWOW64\Macromed\Flash\Flash32_31_0_0_118.ocx" (goto other) else goto x86check

:x86check
REM Checking if the Flash 31 is installed in x86
IF EXIST "C:\Windows\System32\Macromed\Flash\Flash64_31_0_0_118.ocx" (goto other) else goto win7Install

:win7Install
REM Copying the uninstaller file to system temp folder with overwrite parameter
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win7\uninstall_flash_player.exe %Temp% /o /y
SLEEP 10

REM Copying the installer file to system temp folder with overwrite parameter
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win7\install_flash_player_ax.exe %Temp% /o /y
SLEEP 10

REM Uninstalling the Active X flash player 
START /WAIT %temp%\uninstall_flash_player.exe -uninstall -force

REM Installing the Active X flash player 
START /WAIT %temp%\install_flash_player_ax.exe -install

REM Copying Flash mms config file for Internet Explorer
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win7\mms.cfg C:\Windows\SysWOW64\Macromed\Flash /o /y
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win7\mms.cfg C:\Windows\System32\Macromed\Flash /o /y

GOTO :EOF

::----------------------------------------------------------------------------------------------------------
:win10
REM Checking if 32-bit or 64-bit 
IF EXIST "%PROGRAMFILES(X86)%" (set os=x64) ELSE (set os=x86)
::----------------------------------------------------------------------------------------------------------

REM 64 Bit OS
IF %os%==x64 (
ECHO 64 bit operating system detected
REM Checking if the Flash 31 is installed
IF EXIST "C:\Windows\SysWOW64\Macromed\Flash\Flash32_31_0_0_118.ocx" (goto other) else goto win10x64Install

:win10x64Install
REM Copying the uninstaller file to system temp folder with overwrite parameter
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win10\FlashUtil_ActiveX.exe %Temp% /o /y
TIMEOUT 7

REM Uninstalling the Active X flash player 
START /WAIT %temp%\FlashUtil_ActiveX.exe -uninstall -force
TIMEOUT 7

REM Copying the flash files
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win10\64 "C:\Windows\SysWOW64\Macromed\Flash" /o /y
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win10\32 "C:\Windows\System32\Macromed\Flash" /o /y
TIMEOUT 10

REM Registering the flash ocx file
Regsvr32 /S "C:\Windows\SysWOW64\Macromed\Flash\Flash32_31_0_0_118.ocx"
Regsvr32 /S "C:\Windows\System32\Macromed\Flash\Flash64_31_0_0_118.ocx" 

GOTO :EOF	
)

::----------------------------------------------------------------------------------------------------------

REM 32 Bit OS
if %os%==x86 (
ECHO 32 bit operating system detected
REM Checking if the Flash 31 is installed
IF EXIST "C:\Windows\System32\Macromed\Flash\Flash32_31_0_0_118.ocx" (goto other) else goto win10x86Install

:win10x86Install
REM Copying the uninstaller file to system temp folder with overwrite parameter
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win10\FlashUtil_ActiveX.exe %Temp% /o /y
TIMEOUT 7

REM Uninstalling the Active X flash player 
START /WAIT %temp%\FlashUtil_ActiveX.exe -uninstall -force
TIMEOUT 7

REM Copying the flash files
xcopy \\<PUT YOUR DOMAIN>\SYSVOL\<PUT YOUR DOMAIN>\scripts\Adobe\Win10\64 "C:\Windows\System32\Macromed\Flash" /o /y
TIMEOUT 7

REM Registering the flash ocx file
Regsvr32 /S "C:\Windows\System32\Macromed\Flash\Flash32_31_0_0_118.ocx" 

GOTO :EOF	
)

::----------------------------------------------------------------------------------------------------------

:other
GOTO :EOF

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Proudly powered by WordPress | Theme: Code Blog by Crimson Themes.