Uninstalling an MSI file from the command line without using msiexec [closed]

0 votes
asked Jan 16, 2009 by xarzu

msiexec is command prompt software that installs an MSI program. But I have found that you can install an MSI file from the command line by just typing in the name of the MSI file on the command line.

But in order to uninstall the MSI file, it seems you have to call the msiexec program and give it a /x or /uninstall.

How can I uninstall an MSI from the command line without using the msiexec routine?

5 Answers

0 votes
answered Jan 16, 2009 by tuminoid

The msi file extension is mapped to msiexec (same way typing a .txt filename on a command prompt launches Notepad/default .txt file handler to display the file).

Thus typing in a filename with an .msi extension really runs msiexec with the MSI file as argument and takes the default action, install. For that reason, uninstalling requires you to invoke msiexec with uninstall switch to unstall it.

0 votes
answered Jan 16, 2009 by smack0007

I'm assuming that when you type int file.msi into the command line, Windows is automatically calling msiexec file.msi for you. I'm assuming this because when you type in picture.png it brings up the default picture viewer.

0 votes
answered Jan 16, 2009 by roger-lipscombe

Short answer: you can't. Use MSIEXEC /x

Long answer: When you run the MSI file directly at the command line, all that's happening is that it runs MSIEXEC for you. This association is stored in the registry. You can see a list of associations by (in Windows Explorer) going to Tools / Folder Options / File Types.

For example, you can run a .DOC file from the command line, and WordPad or WinWord will open it for you.

If you look in the registry under HKEY_CLASSES_ROOT\.msi, you'll see that .MSI files are associated with the ProgID "Msi.Package". If you look in HKEY_CLASSES_ROOT\Msi.Package\shell\Open\command, you'll see the command line that Windows actually uses when you "run" a .MSI file.

0 votes
answered Jan 21, 2010 by themrnutz

Also remember that an uninstall can be initiated using the WMIC command:

wmic product get name --> This will list the names of all installed apps

wmic product where name='myappsname' call uninstall --> this will uninstall the app.

0 votes
answered Jan 10, 2011 by sdaffa23fdsf
wmic product get name

Just gets the cmd stuck... still flashing _ after a couple minutes

in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, if you can find the folder with the software name you are trying to install (not the one named with ProductCode), the UninstallString points to the application's own uninstaller C:\Program Files\Zune\ZuneSetup.exe /x

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter