The uninstallation process is as important as the installation. And if something in the process goes awry, it can lead to severe malfunctions in a system. That’s why most system administrators have the right to uninstall an MSI package. In this article, we’ll guide you through the most common scenarios of how to uninstall MSI.
ContentsWhen to uninstall an MSI package
How to uninstall MSI
When to Uninstall an MSI Package
There are a few scenarios that require the system administrator to uninstall MSI. First, when an app is no longer needed, it can be deleted from a computer. Second, when an application requires an update, and its previous version must be removed. In both cases, the sysadmin can either employ tools, such as Intune or Microsoft System Configuration Manager , or perform the uninstallation process manually.
How to Uninstall MSI
Here are a few ways how you can easily uninstall an MSI package from a device.
1. Access to the original MSI
This is one of the simplest ways to delete MSI. In the event that the system administrator has access to the original MSI that was used to install the package, they can right-click the MSI and select Uninstall.
2. Use the Programs & Features interface
Another way you can remove an MSI package is through Programs & Features in the Control Panel, where you can locate the Uninstall a Program option by choosing the Category view.
You can also start it by clicking through Control Panel items or directly running “appwiz.cpl”via the “Run” command or CMD.
What’s more, it’s also one of the most used methods in case you need to uninstall something manually.
3. Use the Command Line
Uninstalling your application is easy with the msiexec /x
4. Use the Product Code
The ProductCode can be used to uninstall an MSI. You use the same command line as previously: msiexec /x MSI file path. However, instead of using the path to the MSI file, you use the ProductCode. In addition, the ProductCode method does not require copying MSI to machine to uninstall it.
5. Use PowerShell Start-Process cmdlet
You can start the msiexec.exe process with the Start-Process cmdlet. When the Start-Process cmdlet starts msiexec.exe, specify the required MSIEXEC arguments using the -ArgumentList parameter.
Start-Process “C:\Windows\System32\msiexec.exe” -ArgumentList “/x
6. Use Powershell Get_WmiObject classes
For removing MSI, you can also use WMI. First, we need to obtain WMI object related to specific MSI. This can be done by using Get-WmiObject PowerShell cmdlet. Use “Win32_Product” for Class parameter and provide filtering expression in Filter parameter. After obtaining WMI object, we can call Uninstall() method to remove MSI.
$app = Get-WmiObject -Class Win32_Product -Filter ” IdentifyingNumber=’
You can also filter by ProductName, but ProductName is not a unique identifier (unlike Product\Package codes). Considering that some installed MSIs use identical product names, executing this command may be not possible and\or lead to removal of all products with the same product name.
7. Use the cached MSI
If none of the previous options is not a good choice, the sysadmin can uninstall MSI using the cached MSI, which is stored in the %SystemRoot%\Installer folder.
When you change to the Details view, add Subject and Author columns, and then search for the product name and company name, you will effortlessly locate your MSI package.