15

I need to uninstall a MSI package through command line. So i used:

msiexec /x package.msi

But this command requires the package.msi to be present in the local machine.

I want to uninstall the msi even if the msi file is missing.

How can I do that?

kinokijuf
  • 8,175
  • 9
  • 54
  • 97
Sandeep
  • 390
  • 2
  • 5
  • 14

2 Answers2

15

You can uninstall it using the product code:

msiexec.exe /x {your-product-code-guid}

You would obtain this code from the MSI itself, or whatever tool you are using to build the MSI.

Note that when you uninstall a product, it uses a cached MSI, since only the original MSI knows how to uninstall itself. When you use the product code, it uses the cached MSI from C:\WINDOWS\Installer.

vcsjones
  • 2,533
  • 1
  • 17
  • 20
  • what if you don't have the product id and it doesn't show up under "program and features" after you added the "product id" column? – Tomas Jansson May 13 '15 at 14:04
  • Unfortunately, this still shows "Locate MSI file" dialog – Ivan Nikitin May 11 '16 at 21:15
  • **[How can I find the product GUID of an installed MSI setup?](https://stackoverflow.com/questions/29937568/how-can-i-find-the-product-guid-of-an-installed-msi-setup/29937569#29937569)**. Just in case you don't have the tools to view the MSI file itself. – Stein Åsmul Aug 05 '17 at 21:18
7

See my answer on stackoverflow.com for various ways to uninstall MSI files / Windows Installer Packages from your computer.

You can uninstall via: msiexec, ARP, WMI, PowerShell, Deployment Systems such as SCCM, VBScript / COM Automation, DTF, or via hidden Windows cache folders, and a few other options.

Stein Åsmul
  • 1,099
  • 1
  • 15
  • 25