Deploying Adobe Flash Player (currently with SCCM 2012 (Current Branch ver. 1706) previously removing all older versions.

Update 10/10/2017: The script and instructions were updated to reflect latest versions of SCCM and Adobe Flash Player versions.

I have been managing software deployments and updates/patching with SCCM 2012 (latest version 1607) in our organization with about 5500 workstations in the production environment. We have 3rd party software (Shavlik) installed to manage software updates, but I noticed that it is not always perfect for situations where multiple major versions of the software are installed. During my testing, I tried to deploy Adobe Acrobat Reader DC to replace Reader 11 and Adobe Flash Player replace older versions of Flash (we had some old ones like 13, 15, 18, 21, 22).  After the patches deployment, I noticed that it will bring up the patch level to the current one , given it's been approved and downloaded in Shavlik. In other words, it will not upgrade the major version of the product ( from Adobe Reader 11 to DC , or from Flash 18 to 27). Configuring SCCM application with just plain .msi installer also doesn't remove older major versions of the Flash players.

So, I had to come up with the solution to remove older version and install new one during the deployment process. 

   I decided to use powershell script to handle that installation/upgrade process, and then deploy it within an application (not the package or Task Sequence). 

Here are two scripts I used to deploy (ActiveX and Plug-in): 


if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent } #In case if $PSScriptRoot is empty (Older version of powershell).  

#Close all open instances of Internet Explorer
Get-Process | ? { $_.ProcessName -match 'msiexec' } | Stop-Process -Force
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force
(New-Object -COM "Shell.Application").Windows() | ? { $_.Name -like "*Internet Explorer*" } | % { $_.Quit()
     [Runtime.Interopservices.Marshal]::ReleaseComObject($_) }
Get-Process | ? { $_.ProcessName -match 'iexplor' } | Stop-Process -Force

Start-Process -FilePath "$PSScriptRoot\uninstall_flash_player.exe" -ArgumentList $PlugInUnInstallArgs -Wait

#Installing Adobe Flash Player ActiveX
Try    {
$FlushActiveXInstallArgs="/i","`"$PSScriptRoot\install_flash_player_27_active_x.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_ActiveX_27.0.0.130_Install.log"
Start-Process msiexec.exe -ArgumentList $FlushActiveXInstallArgs -Wait -ErrorAction Stop -ErrorVariable ErrorDescription
$Result= [System.Environment]::ExitCode
If (!(Test-Path -Path 'C:\Program Files (x86)')) { Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\System32\Macromed\Flash\mms.cfg -Force } Else {Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\SysWow64\Macromed\Flash\mms.cfg -Force}

Catch  {
        $Result = [System.Environment]::Exitcode


if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent } #In case if $PSScriptRoot is empty (Older version of powershell).  

#Close all open instances of MSIExec.exe and open Flash Player
Get-Process | ? { $_.ProcessName -match 'msiexec' } | Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force -ErrorAction SilentlyContinue

Start-Process -FilePath "$PSScriptRoot\uninstall_flash_player.exe" -ArgumentList $PlugInUnInstallArgs -Wait

# Install install_flash_player_27_plugin.msi for all versions of Windows ( 7, 8, 8.1, 10 )
Try    {
$FlushPlugInInstallArgs="/i","`"$PSScriptRoot\install_flash_player_27_plugin.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_PlugIn_Install_27.0.0.130.log"
Start-Process -FilePath msiexec.exe -ArgumentList $FlushPlugInInstallArgs -Wait -ErrorAction Stop
$Result= [System.Environment]::ExitCode

If (!(Test-Path -Path 'C:\Program Files (x86)')) { Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\System32\Macromed\Flash\mms.cfg -Force } Else {Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\SysWow64\Macromed\Flash\mms.cfg -Force}

Catch  {
        $Result = [System.Environment]::Exitcode

I also have mms.cfg file (config file that disabled Auto-updates) and the uninstaller (can be downloaded here: https://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html ) in the same folders:

AutoUpdateDisable = 1  #Disables Auto-Update of Adobe Flash Player 

I created my source directories for these applications and placed all files in there. 

After downloading .msi installer files from Adobe distribution site and uninstaller into the source directories on the network source locations I  had 4 files in each folder:

Once all files and folders are ready, I created 2 applications: one for Adobe Flash Player ActiveX (for IE), and the second one for Adobe Flash Player Plug-In ( for Firefox, etc.). 

For each application, I started Create Application Wizard and followed all steps pointing to correct location and the .MSI installer (for ...Active_x.msi or ...Plugin.msi in the directories above). After its completed, I just modified  Application Catalog, User Experience, and Requirements (not to deploy on Windows 8.x or Windows 10 for ActiveX - Plug-In version can be deployed to Windows 8.x and 10) and Programs of the Deployment Type to start correct .ps1 scripts with powershell.  

Here how ActiveX app properties look like:

You can use your favorite search engine to look for and download Icon for your application to be displayed in the Software Center.

Here is how my Deployment type looks like:

As for the Installation program, I have this command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -file .\Install_Flash_ActiveX.ps1

Or for the PlugIn version: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -file .\Install_Flash_PlugIn.ps1

( Keep in mind, If your company policy for powershell execution is set for signed or remote signed, make sure to modify the install command to reflect that and sign those PS script files).

And for uninstall program: uninstall_flash_player.exe -uninstall activex   (or for the PlugIn version: uninstall_flash_player.exe -uninstall plugin  )

Detection Method was automatically generated during the Create Application Wizard. 

In the Requirements tab, I limit deployments only to those Operating Systems: Windows XP, Vista, 7, 8. 

Adobe Flash Player ActiveX cannot be installed on Windows 8.1 and Windows 10 with .msi installer. They should be upgraded with Windows Update.   

You can specify Application Supersedence If you have older versions of the Flash Player deployed with SCCM. Please note that this selection is irrelevant to which version will be uninstalled with the script. It will just mark this application as superseding one of those older versions you might have deployed prior. When you deploy that script, you don't have to worry about making sure that "Uninstall Program" of your old Applications Types works.  Powershell script removes all older versions of the apps, then installs new versions.


Above screenshots are for the creating ActiveX version of the Flash player. Create other versions of the Flash player with some modifications.

After applications are created, distribute content to your Distribution points, retire old versions of the Adobe Flash Player applications and deploy your new Applications. Also, If you install Flash Player during OS Deployment, don't forget to update your Task Sequences to install your latest applications. 

Feel free to use those scripts and techniques in your deployments. and let me know If you have better ways deploy those upgrades of older apps.



  • Thanks for well described Guide.
    i cannot access adobe distribution to download flash player files. may you please share these files ? - mohammadravaghi 7 years ago
    • You'll have to agree to their distribution license in order to get access to the files. - vjaneczko 7 years ago
  • i filled their licensing and waiting for about 1 week. but no news no contacts no calls... my enterprise staff are killing me for this feature and yet no access. so please if you can give me access to this sources. - mohammadravaghi 7 years ago
    • By providing you, or anybody with download link or file itself I would violate that distribution agreement I signed with Adobe. You need to find a way to apply and to receive your own email from Adobe. Sorry :( - emilchik 7 years ago
  • i just filled that 3 time and they dont answer. trying you was the last chance for me :-( - mohammadravaghi 7 years ago
  • Can we combine both ActiveX and Plugin into same powershell script instead creating 2 application? - AnIT 7 years ago
    • Theoretically, you can, but you will be missing reporting part of that application. Also, you would have to deploy it to Windows 8 - 10, which do not need ActiveX Flash player, only plug-in version, if they have Chrome or Firefox installed. You would have to be really creative and add logic inside the script to filter out those OSs, create your own return codes, which would determine if ActiveX needs to be installed or not, if it installed successfully, if either one of those apps requesting computer reboots, and pass them to SCCM to handle. I also wanted to just create one app and ignore all those return codes. but it can backfire at you if one of the apps is not going to be installing correctly/successfully and help desk will be flooded with calls because of it.
      Do yourself a huge favor, don't try it in the production environment :) - emilchik 7 years ago
  • Use this for cleaning up older versions of Flash Player:

    #Flash Player Preinstall Cleanup Script#
    # Creation Date: 01/15/2017 #
    # Version: 24 #
    # Author: Stephen Wheeler #

    $CurVer = "FlashPlayer_24.0.194"

    Start-transcript -path C:\Log\SCRIPTS\FlashPlayer_DetailedLog.txt -noClobber -Append

    #This is calling the "Flashutil" application to attempt to uninstall the currently installed version of Flash Player.
    Write-Host "First Off we are going to politely ask Flash Player to remove itself.`r"

    $Flashutil = (Get-Childitem C:\Windows\system32\Macromed\Flash\FlashUtil*ActiveX.exe -name)
    $FlashTest = (Test-Path C:\Windows\system32\Macromed\Flash\FlashUtil*ActiveX.exe)
    $Flashutil1 = (Get-Childitem C:\Windows\system32\Macromed\Flash\FlashUtil*Plugin.exe -name)
    $FlashTest1 = (Test-Path C:\Windows\system32\Macromed\Flash\FlashUtil*Plugin.exe)
    IF ($FlashTest -eq $True)
    Start-Process -FilePath "C:\Windows\system32\Macromed\Flash\$Flashutil" -Argumentlist "-uninstall" -ErrorAction SilentlyContinue
    Write-host "Successfully ran ActiveX Uninstaller`r"
    Write-Host "ActiveX Plugin is Not coming off nicely`r"

    IF ($FlashTest1 -eq $True)
    Start-Process -FilePath "C:\Windows\system32\Macromed\Flash\$Flashutil1" -Argumentlist "-uninstall" -ErrorAction SilentlyContinue
    Write-host "Successfully ran NPAPI Uninstaller`r"
    Write-Host "NPAPI plugin is Not coming off nicely`r"

    #When MSIEXEC is running it causes problems with the installation of Flash, there for I am having it forcivly end it, if it is running.
    Write-Host "Attempting to Terminate msiexec.exe`r"
    $Process = Get-Process msiexec -ErrorAction SilentlyContinue
    if ($Process -eq $True) {Stop-Process - msiexec -Force -ErrorAction SilentlyContinue}

    #These are the GUIDs of each version of FlashPlayer and they can be found by Searching "Flash Player" in this Key: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
    #There is one for the ActiveX and one for NPAPI Plugin
    #When Building a new Flash Plackage you just need to add the 2 new GUIDs to this list.
    $GUID = @("{56680CC0-AA4D-47DB-A1A3-B26A97F1D3F1}",

    #These are the SIDs of each version of FlashPlayer and they can be found by Searching "Flash Player" in this Key: HKLM:\SOFTWARE\CLASSES\Installer\Features\.
    #There is one for the ActiveX and one for NPAPI Plugin.
    #When Building a new Flash Plackage you just need to add the 2 new SIDs to this list.
    $SID = @("3958907FC4F2C234CAF8D696CDE9DF9C",

    #Removing all the records for any previous version.
    Write-Host "Removing the Macromedia Key $(get-date -format `"yyyyMMdd_hhmmsstt`")`r"

    $flash1 = (Test-Path -Path "HKLM:\SOFTWARE\Macromedia\FlashPlayer")
    $Flash2 = (Test-Path -Path "HKLM:\SOFTWARE\WOW6432Node\Macromedia\FlashPlayer")
    $Flash5 = (Test-Path -Path "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX")

    if ($Flash1 -eq $True) {Write-Host "Successfully Deleted HKLM:\SOFTWARE\Macromedia\FlashPlayer `r"
    Remove-Item -path "HKLM:\SOFTWARE\Macromedia\FlashPlayer" -Recurse -ErrorAction SilentlyContinue}
    if ($Flash2 -eq $True) {Write-Host "Successfully Deleted HKLM:\SOFTWARE\WOW6432Node\Macromedia\FlashPlayer`r"
    Remove-Item -path "HKLM:\SOFTWARE\WOW6432Node\Macromedia\FlashPlayer" -Recurse -ErrorAction SilentlyContinue}
    if ($Flash5 -eq $True) {Write-Host "Successfully Deleted HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX`r"
    Remove-Item -path "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX" -Recurse -ErrorAction SilentlyContinue}

    Write-Host "Searching for and deleting any previous version of Flash. $(get-date -format `"yyyyMMdd_hhmmsstt`")`r"
    foreach ($GUIDS in $GUID)
    $regPath2= "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS"
    $value2 = (Test-Path $regpath2)

    $regPath64= "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS"
    $value64 = (Test-Path $regpath64)

    if ($value2 -eq $True) {Write-Host "Successfully Deleted $Regpath2`r"
    Remove-Item -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS" -Recurse -ErrorAction SilentlyContinue}
    if ($value64 -eq $True) {Write-Host "Successfully Deleted $Regpath64`r"
    Remove-Item -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS" -Recurse -ErrorAction SilentlyContinue}

    #I couldnt get this one to check whether the file exists because its a value instead of a key, so I am just suppressing errors and having it try to delete any of the versions.
    $UIPath = "C:\Windows\Installer\$GUIDS\"
    Remove-ItemProperty -Path "hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" -name $UIPath -ErrorAction SilentlyContinue
    Remove-ItemProperty -Path "hklm:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Installer\Folders" -name $UIPath -ErrorAction SilentlyContinue

    Write-Host "Deleted all the GUIDs that were present, now searching for and deleting SIDs. $(get-date -format `"yyyyMMdd_hhmmsstt`")`r"
    foreach ($SIDS in $SID) {

    $sidpath1 = "HKLM:\SOFTWARE\CLASSES\Installer\Features\$SIDS"
    $Sidtest1 = (Test-Path $Sidpath1)

    if ($sidtest1 -eq $True){Write-Host "Successfully Deleted $sidpath1`r"
    Remove-Item -path $sidpath1 -Recurse -ErrorAction SilentlyContinue}

    $Sidpath2 = "HKLM:\SOFTWARE\Classes\Installer\Products\$SIDS"
    $Sidtest2 = (Test-Path $Sidpath2)
    if ($sidtest2 -eq $True){Write-Host "Successfully Deleted $sidpath2`r"
    Remove-Item -path $sidpath2 -Recurse -ErrorAction SilentlyContinue}

    $Sidpath3 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SIDS"
    $SidTest3 = (Test-Path $Sidpath3)
    if ($sidtest3 -eq $True){Write-Host "Successfully Deleted $sidpath3`r"
    Remove-Item -path $sidpath3 -Recurse -ErrorAction SilentlyContinue}

    $Sidpath4 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\$SIDS"
    $Sidtest4 = (Test-Path $Sidpath4)
    if ($sidtest4 -eq $True){Write-Host "Successfully Deleted $sidpath4`r"
    Remove-Item -path $sidpath4 -Recurse -ErrorAction SilentlyContinue}

    $sidpath641 = "HKLM:\SOFTWARE\Wow6432Node\CLASSES\Installer\Features\$SIDS"
    $Sidtest641 = (Test-Path $Sidpath1)
    if ($sidtest641 -eq $True){Write-Host "Successfully Deleted $sidpath1`r"
    Remove-Item -path $sidpath641 -Recurse -ErrorAction SilentlyContinue}

    $Sidpath642 = "HKLM:\SOFTWARE\Wow6432Node\Classes\Installer\Products\$SIDS"
    $Sidtest642 = (Test-Path $Sidpath642)
    if ($sidtest642 -eq $True){Write-Host "Successfully Deleted $sidpath642`r"
    Remove-Item -path $sidpath642 -Recurse -ErrorAction SilentlyContinue}

    $Sidpath643 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SIDS"
    $SidTest643 = (Test-Path $Sidpath3)
    if ($sidtest643 -eq $True){Write-Host "Successfully Deleted $sidpath643`r"
    Remove-Item -path $sidpath643 -Recurse -ErrorAction SilentlyContinue}

    $Sidpath644 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\$SIDS"
    $Sidtest644 = (Test-Path $Sidpath644)
    if ($sidtest644 -eq $True){Write-Host "Successfully Deleted $sidpath644`r"
    Remove-Item -path $sidpath644 -Recurse -ErrorAction SilentlyContinue}


    #Now Just to run the installs
    Write-Host "Flash is removed"

    Stop-Transcript - swheeler911 7 years ago
    • Hi,
      Thanks for your post.
      At one point I did use something similar to remove older versions, but it became too labor intensive to search up and maintain SIDs for each version of the Flash player Adobe releases.
      That's why I decided to go with WMI query of the installed programs.
      You're welcome to use anything you want in your deployments, but I found that simpler scripts work better, plus you don't have to maintain the list of those SIDs every time Adobe decides to spit out another version of the Flash player.
      I also tried using Adobe provided "remover utility". But it didn't work for me because you can not specify the version of the software to keep. Since I was deploying two applications, first application was deployed fine, but once the second application started to run and Uninstall utility is running before Install of the new Flash player run, it removes the first application. In other words, If ActiveX version is installed first, then Add-on starts an installation, it removes the ActiveX version. - emilchik 7 years ago
  • Why is it necessary to use a sledgehammer to crack a nut?
    Instantiate the windows installer object
    Read in all the installed MSI apps
    Search each app name for Adobe flash
    Get the app guid
    Run the msiexec uninstall using the guid
    Rinse and repeat.
    No code maintenance necessary. - EdT 7 years ago
  • Hi All, that looks like a massive script. Not sure if you are aware but there is an uninstall tool that adobe have to remove previous versions


    I have just a basic batch that calls this and then the Exe installer for flash (which you can find on the troubleshooting page) - doug.austin 7 years ago
  • Great write up, i plan to test this tomorrow when i'm in the office....

    One question though... is it absolutely mandatory to quit IE when installing the latest version.

    In fact, i have been overinstalling for the longest now (up to version and i do not have issue with old versions of flash. But we just got this new toy (SCCM) and i want to kick the tires.

    Additionally we were not quitting IE and having positive results of the flash player being updated on next launch - soberone 7 years ago
  • Hi.
    I noticed two things while deploying flash. Ocasionally, if IE has page with flash elements, it will fail deployment, that's why I close it.
    Another one, Adobe uninstall tool also corrupts other installation. If your plug-in version is installed first , ActiveX install with that tool running will corrupt it. And another way around.
    Cheers - emilchik 7 years ago
  • You might also try using the Adobe Flash Player uninstaller at "https://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html". It seems to work pretty well. - Tim T. 6 years ago
    • Thank you, Tim, but that is the manual method. It is not an option for mass deployment to a few hundred of thousands of computers, possibly located over a large geographical area and different time zones. - emilchik 6 years ago
  • I guess I could have provided more detailed information, sorry. If you open the "ADOBE FLASH PLAYER 25.0 Administration Guide", linked from "http://www.adobe.com/devnet/flashplayer/articles/flash_player_admin_guide.html", there is a section on uninstalling Adobe Flash Player, including the syntax for doing so silently. One thing to look out for is that new versions of the uninstaller tool are released when new versions of Flash Player are released, so you need to remember to download the new uninstaller version with each deployment. I hope this helps. - Tim T. 6 years ago
  • Hello.. I hope the author still follows this article. I did what was listed in the article. I only made the edits necessary for it to run the latest adobe version 27. I ran it and it did install the latest adobe 27 on my test machine but it seems the uninstall older versions did not run as I still had an older version on the machine and the "uninstall" log was never created so I do not know what happened. the install log was created. any ideas on why the uninstall failed? - Menz01 6 years ago
    • I also noticed that since version 27.xxx if product is installed with .exe file, it will not be removed with the script provided above. I had to change the script and use Adobe provided new uninstaller. I'll update the script and instructions. - emilchik 6 years ago
      • when I applied to the adobe distribution license site after I was approved, I was directed to a page where I could download adobe 27 in MSI packages. so when I modified the scripts all I did was modify the package name not the file type. still does not explain why the uninstaller part which is step 1 in the script did not run. - Menz01 6 years ago
    • The script and instructions were updated to reflect latest versions of SCCM and Adobe Flash Player versions. - emilchik 6 years ago
  • The script and instructions were updated to reflect latest versions of SCCM and Adobe Flash Player versions. - emilchik 6 years ago
  • thank you. initial test are showing good so far - Menz01 6 years ago
  • Am I correct thinking that because of the uninstaller one Application will remove the other if deployed afterwards to the same machine? - lukasos 5 years ago
    • Hi. Adobe updated uninstaller utility and now it works as expected. You can read on it more in the admin guide for the Flash. I'll update the post later on. - emilchik 5 years ago
This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ