Windows – How to Uninstall a Program Using UninstallString in REGEDIT with CMD/MSIExec

windows

I found the registry key UninstallString while trying to uncover the path to an uninstaller. This was found in HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

The UninstallString Contained: MsiExec.exe /X{DBB43649-A97A-41A2-80E4-20E1D2340EBC}

I interpret this as Windows using the MsiExec.exe with flag /X on path {DBB43649-A97A-41A2-80E4-20E1D2340EBC}.

However, when I try the command in CMD(as admin) it does not find the uninstall. When I run Program files, program files finds wherever this MSI is behind the scenes and uninstalls it so Windows knows where it is ultimately.

My main goal was to get a script created to uninstall software for multiple Windows Servers.
Is there a way to find the uninstaller for a program so it can be uninstalled via CMDs MSIExec?

Thank you for any assistance and direction

Best Answer

{DBB43649-A97A-41A2-80E4-20E1D2340EBC}is the ID of the program, no the file or path. You could look the application up at HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID or in powerhell withget-wmiobject Win32_Product | Format-Table IdentifyingNumber, Name.

However, MsiExec.exe /X {DBB(...) should always work. If you get a 'File not found' error, check if msiexec is in your path.