Application Delivery Management
Application Modernization & Connectivity
CyberRes
IT Operations Management
@echo off
REM Written by Ed Radke DTS/Corrections
REM Script query's WMI for MSI packages names containing the string stored in variable '__FILTER'.
REM Then, it performs a silent uninstall of any packages that it finds a match.
REM A string that will be searched for in the product name to be uninstalled.
REM BE CAUTIOUS WHAT YOU TYPE HERE.
REM too broad of a query could render your system useless.
REM If you're not sure try this wmic command alone to see what it returns:::
REM wmic product where (name like "%PUT_YOUR_STRING_HERE%") get name,packagecache /format:csv
set __FILTER=groupwise
REM Output of wmic
set __OUT=%TEMP%\WMIC_GW.TXT
REM Uninstall Log file
SET __LOG=C:\gw_remove.txt
REM Remove output if it exists
if exist "%__OUT%" del /f /q "%__OUT%" >NUL 2>&1
echo Initializing
REM search for MSI product's local package
wmic /output:"%__OUT%" product where (name like "%%%__FILTER%%%") get name,packagecache /format:csv
REM Output is unicode, convert to ANSI
type "%__OUT%" >"%__OUT%.tmp"
type "%__OUT%.tmp" >"%__OUT%"
REM Perform uninstall, reboot is suppressed
for /f "usebackq tokens=2,3 skip=2 delims=," %%A in ("%__OUT%") do (
echo Un-installing "%%A"
msiexec.exe /x "%%B" /qn /l*v "%__LOG%" REBOOT=REALLYSUPPRESS
)