Windows MSI File Clean Remove Adobe Flash Player

From richud.com
Jump to navigation Jump to search

This mostly only applies to an MSI installed Flash Player (ProductName-remove.bat part)

Remotely Remove Main Fix script

This calls two removal files to run on the remote pc (which can be run standalone if needed)

  • Generic MSI Cleaner/ProductName remover, ProductName-remove.bat, appending the product to remove, "Flash Player". This only applies to MSI installed Flash Player
  • An extra cleaner file to remove specific Flash file/folder remnants, flashremove.bat

Flashremovefix.bat

@echo off
echo    ___  __  ______  _____
echo   / _ \/  ^|/  / _ \/ ___/   RMDC
echo  / , _/ /^|_/ / // / /__     Flash Player
echo /_/^|_/_/  /_/____/\___/     Remove (MSI Installed)
echo.

echo ---=== Last updated 04/Mar/2012 ===---
echo.

if [%1%] == [] (
 set /p h=Enter Hostname or IP :
) ELSE (
 set h=%1%
)

echo Ping testing %h%...
ping -n 2 -l 1 %h% >nul
if %errorlevel% neq 0 set f=Cannot ping host & goto fail
echo RPC testing %h%...
net use \\%h% /persistent:no >nul
if %errorlevel% neq 0 set f=RPC connection dead, WMI maybe screwed & goto fail
net use \\%h% /d >nul
COLOR 2
echo Machine alive and connectable!
echo.

copy /y *.bat "\\%h%\c$\temp\"
copy /y *.exe "\\%h%\c$\temp\"

psexec -e \\%h% "c:\temp\ProductName-remove.bat" "Flash Player"
psexec -e \\%h% "c:\temp\flashremove.bat"

echo You need To Reboot Now
pause

ProductName-remove.bat

Please see here for full info

  • Relies on msiinfo.exe and msizap.exe

Flashremove.bat

  • Relies on icacls.exe, to reset file/folder permissions. Available form Server 2003 SP2, [Icacls.exe 5.2.3790.4213 40,448 02-Jan-2008 11:30 x86]


@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS


rem Log output
set log=%temp%\flashremove-log.txt


echo Removing Flash files folder
%~dp0icacls.exe "\\.\%windir%\system32\Macromed" /reset /T /C >> "!log!" 2>&1
attrib /s /d -R -H -S "\\.\%windir%\system32\Macromed\Flash\*" >> "!log!" 2>&1
del /f /q /s "\\.\%windir%\system32\Macromed\Flash" >> "!log!" 2>&1
rmdir /s /q "\\.\%windir%\system32\Macromed\Flash" >> "!log!" 2>&1


echo Removing from SMS, package GID will vary on your system, so change it.
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\AppMgmt\{11a47ba3-e430-44a4-8025-eb1666e1d611}" /f >> "!log!" 2>&1

echo Finished removing Flash files
echo Please check the log: %log% for details

File Structure

These are the files you should have present, with file sizes shown

├── [        713]  flashremove.bat
├── [        868]  flashremovefix.bat
├── [      39936]  icacls.exe
├── [      89600]  MsiInfo.exe
├── [      94720]  MsiZap.exe
└── [       2441]  ProductName-remove.bat

Further Info

Original and More verbose explanation to remove Flash Player