Skip to content

Instantly share code, notes, and snippets.

@cgddrd
Created January 21, 2017 20:35
Show Gist options
  • Save cgddrd/307417540e4f07b220eb10cc1b1a6217 to your computer and use it in GitHub Desktop.
Save cgddrd/307417540e4f07b220eb10cc1b1a6217 to your computer and use it in GitHub Desktop.
Performs silent uninstall of an MSI application via product key lookup from supplied application name wildcard.
@echo off
rem Uninstall MSI application via Product-Key GUID Lookup.
rem Modified from original source: http://stackoverflow.com/q/30790561
rem Extract Product Key GUID for provided product name wildcard ('%%b'), before performing silent uninstall.
for /f "skip=1 delims=" %%a in (
'wmic product where "Name like '%%INSERT_PRODUCT_NAME_WILDCARD%%'" get identifyingnumber'
) do @for /f "delims=" %%b in ("%%a") do msiexec /x %%b /qb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment