AFAIK password protecting installers isn't built-in to MSI installers and would be a custom uninstallation feature provided by the software maintainer. You will need to reference the software manufacturer's documentation on removing the software via automation.
Note: Avoid using the Win32_Product
class, as simply enumerating it will trigger a reconfigure on any installed products that fail the integrity check which happens when you enumerate a given Win32_Product
. Dumb, I know, but it's just how that WMI class works. My answer above offers an alternative way to list installed products and you can get the uninstallation information directly from the same registry location as well.
Once you get the program's ProductCode
, you can run
msiexec /x PRODUCTCODE ADDITIONAL_PARAMETERS
to uninstall the software. The password will likely be provided by an MSI parameter the software maintainer should have documented or be able to tell you, and will come after any additional logging arguments to msiexec
.
If you are trying to do this with software installed with an EXE installer that does not use an embedded MSI to install the software, you will be entirely at the whim of the software maintainer for how to uninstall the program via automation, as non-MSI installers do not have the standard Microsoft Installer properties associated with them, nor can you remove these with msiexec
.