Scripting Question

Script to remove old flash player silently ?

02/12/2015 19796 views

I looking for a simple script, that disables Flash player automatic updates and notifies. And how do I remove old flash player silently with a script ? Because I cannot run over the old flash with the new one.

Thx for feedback!
0 Comments   [ + ] Show comments


All Answers

Just download their uninstaller and run it with a -uninstall switch, it will run silently.  We just wrap it in a winbatch exe, that also follows with the install of the latest version...They make and uninstaller for 32 and 64 bit.  Easy peasy!


Also, best way to thwart updates is with a GPO that disables this service AdobeFlashPlayerSvc, why use a screw driver when you can use a hammer.  :)  We use the "hammer" GPO because we are in a very large Gov't environment and need strict control of updates, etc.

Answered 02/18/2015 by: oleinwi
Orange Belt

This content is currently hidden from public view.
Reason: Member has been banned from the site banned by admin For more information, visit our FAQ's.

 #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"


Answered 04/01/2016 by: swheeler911
White Belt

  • Great Script Stephen.
    Just what I need, because uninstall flash player.exe does not work in my situtation.
    Do you have the latest version. Could you post that version.
    It would help enormous if you could also make it work for "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" because of eg:
    "DisplayName"="Adobe Flash Player 20 NPAPI"
    "DisplayName"="Adobe Flash Player 16 NPAPI"
    • This content is currently hidden from public view.
      Reason: Removed by member request For more information, visit our FAQ's.
  • I can add the 64 bit stuff but up until this point, I myself have not needed it even when dealing with 64bit machines. Also, I only have the SID's and GUID's for versions I have come across so I am sure there some releases I missed. The first part of the script will remove a good majority of that if it is able to run, regardless of the version.
    Also there is no need to add a line for each version, you can just use the List loop variable for the 64bit paths. if I get some time today I can through that in real quick.

    One other thing, I have looked at the full list of Guid and SIDs listed on the Adobe site and it isn't accurate. There are some that exist and some that don't. The list I compiled is from actual installs copy them from the registry.

    You are also right about the GUID that was incorrect. Looks like I was doing a Ctrl + H replace for a version change and that GUID happened to have the version number 186 in it so it change to the new version 194. Either way I changed that and I will update the comment with the latest script
  • I added in your requested changes as well as the additional Sid's you provided. I updated the original comment with the newest script
I dont normally use the Utility to uninstall FlashPlayer.

first of all, is FlashPlayer or Flashplayer Plugin are you trying to uninstall? Normally the new version should look after the uninatllation of old version but some time what happens with flash player Not plugin the .ocx file are missing in flash folder and will complain during the uninstall what i normmaly do is deploy a dummy files prior to new deplyment by using a batch file. example below. for 32 bit and also for 64 bit

IF EXIST C:\Windows\SysWOW64\sysprep GOTO Win7


IF NOT EXIST C:\Windows\System32\Macromed MKDIR C:\Windows\System32\Macromed
IF NOT EXIST C:\Windows\System32\Macromed\Flash MKDIR C:\Windows\System32\Macromed\Flash
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_2_202_228.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_2_202_228.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_3_300_257.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_3_300_257.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_4_402_287.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_4_402_287.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_5_502_146.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_5_502_146.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_6_602_168.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_6_602_168.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_6_602_180.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_6_602_180.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_7_700_169.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_7_700_169.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_7_700_224.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_7_700_224.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_8_800_94.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_8_800_94.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_8_800_175.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_8_800_175.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_11_9_900_152.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_11_9_900_152.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_12_0_0_44.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_12_0_0_44.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_12_0_0_70.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_12_0_0_70.ocx
IF NOT EXIST C:\Windows\System32\Macromed\Flash\Flash32_13_0_0_206.ocx echo 1 > C:\Windows\System32\Macromed\Flash\Flash32_13_0_0_206.ocx

goto end


IF NOT EXIST C:\Windows\SysWOW64\Macromed MKDIR C:\Windows\SysWOW64\Macromed
IF NOT EXIST C:\Windows\SysWOW64\Macromed\flash MKDIR C:\Windows\SysWOW64\Macromed\flash
IF NOT EXIST C:\Windows\SysWOW64\Macromed\flash\Flash32_12_0_0_44.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_12_0_0_44.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_2_202_228.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_2_202_228.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_3_300_257.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_3_300_257.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_4_402_287.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_4_402_287.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_5_502_146.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_5_502_146.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_6_602_168.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_6_602_168.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_6_602_180.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_6_602_180.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_7_700_169.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_7_700_169.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_7_700_224.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_7_700_224.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_8_800_94.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_8_800_94.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_8_800_175.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_8_800_175.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_11_9_900_152.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_11_9_900_152.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_12_0_0_70.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_12_0_0_70.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_12_0_0_44.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_12_0_0_44.ocx
IF NOT EXIST C:\Windows\Syswow64\Macromed\Flash\Flash32_13_0_0_206.ocx echo 1 > C:\Windows\Syswow64\Macromed\Flash\Flash32_13_0_0_206.ocx


try this but make sure you include all the versions of the .ocx file in your enviorenment.

I also have unisntall script if you needed but try this first.

Answered 02/18/2015 by: Prabs
Senior White Belt


[closes eyes, grits teeth] Don't give in...don't post a LMGTFY link...don't give in...

Disabling Flash's auto-update function should be performed at the packaging/deployment level (depending on how you're deploying). It's documented to death on IT Ninja e.g. here and on Adobe's web site.

Answered 02/12/2015 by: VBScab
Red Belt


1.      Open notepad and save the file as mms.cfg  with following details in the file.



2.      Save file then need to be deployed to belowlocation according to architecture type.

64 bit


32 bit



More details can be found below


Answered 02/12/2015 by: Prabs
Senior White Belt

  • In the past, this had to be saved as a Unicode file and not a standard text file. Has this changed recently?
    • I think it still needs to be Unicode, I have been using the same file for prob 6 or 7 years
Thx Prabs!

But before I can install the flash I need to remove the old one, does anyone have a script for that? Have google it, but no luck. Version we talking about is 15.
Answered 02/12/2015 by: Swede
Blue Belt

  • I have never used this but Adobe has an official uninstall tool described in this article:


    You could also make a batch file using commands like ones found here (look up and substitute yours) and then execute that first.

The MSI's Upgrade table contains the UpgradeCodes for versions from up to (what I'm calling) the current version, It should just work. If it doesn't, you may have to add the UpgradeCode from whatever MSI installed v15 for you and add it to the MSI you're currently using.

If that MSI doesn't contain an Upgrade table, it's not the official Adobe MSI and you will have to populate the Upgrade table yourself.
Answered 02/12/2015 by: VBScab
Red Belt

1) Copy and paste below into a Batch file.
2) this will install but just convert it to a uninstall (can get the uninstall string from KACE)
3) run the batch from a KACE script

@echo off

echo Installing Adobe Flash Player 13

pushd "\\wallowa\Apps\Adobe\Flash Player 13.x"

call msiexec /i install_flash_player_13_active_x.msi /qb /norestart



Answered 02/12/2015 by: nickbaldwin86
Yellow Belt

The flash installs are MSI files for heavens sake. Just run the following to uninstall any version:

msiexec /x <product code of old version> /qn
Answered 02/12/2015 by: EdT
Red Belt

Flash installs are exe I think. 

This command should work, but when I run it, it required a user interaction. Cannot find a working switch for silent uninstall.

C:\Windows\system32\Macromed\Flash\FlashUtil32_16_0_0_305_Plugin.exe -maintain plugin

This work!
C:\Windows\system32\Macromed\Flash\FlashUtil32_16_0_0_305_Plugin.exe -uninstall
Answered 02/13/2015 by: Swede
Blue Belt

  • << Flash installs are exe I think. >>
    Adobe's packaging of Flash is a joke. The EXE that you download extracts and executes an MSI. Open the EXE with 7Zip and you'll see it there. However, the MSI simply extracts and executes yet another EXE.
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