Заметки сисадмина » Safely remove *.msi and *.msp files that are in C:\Windows\Installer but are not the mentioned in the registry

Заметки сисадмина о интересных вещах из мира IT, инструкции и рецензии. Настраиваем Компьютеры/Сервера/1С/SIP-телефонию в Москве

Safely remove *.msi and *.msp files that are in C:\Windows\Installer but are not the mentioned in the registry

2020-11-19 · Posted in Windows – 10

The following VBS clean-windows-installer pass1 uninstalls MSP patches marked as superseded:

This needs to be run with cscript.

This is completely SAFE as it does not remove any .msp files manually, but only calls Windows Installer to uninstall patches which have been marked as superseded in registry!
Your uninstall and future patching capability will be unhindered!
On systems which have Office 2013 installed this can save several GB’s of old versions of large patches such as mso, excel, word, project…
This script is hereby released into public domain and comes without ANY WARRANTY.
The ReconstructProductCode function is shamelessly stolen from here, but probably does not meet the threshold of originality, as there are only so many ways to write the GUID-unmunging algorithm.
More MSI space to save: Set the MaxPatchCacheSize policy to 0 and delete everything inside the $PatchCache$ folder. This is actually the ONLY thing that is safe to delete manually in %SystemRoot%\Installer.
After doing this, uninstalling patches for some very old products may prompt for the original installation source. This does NOT include Office 2007+, Acrobat Reader DC or Visual Studio 2012/2013, as they cache the original source anyway and the $PatchCache$ is completely redundant and useless.

To uninstall permanent patches (like Adobe Reader and Silverlight) run the script with the “/f” option. I recommend to run the script normally first.

When uninstalling Silverlight patches, a harmless warning message “Could not write value UpdateConsentMode…” appears. Click Ignore
When Uninstalling Adobe Reader patches (, the script needs to be run several times due to Adobe Reader using incremental service packs in the past — the script does not know the order in which patches need to be removed.
EDIT: Some Reader updates can’t be removed even with the /f option. This usually means that the lastest update is installed from a delta patch rather than cumulative, and the older patch files are still needed. They will be able to be removed if you install a later cumulative patch.

Leave a Reply