Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clean unused COM registration from the registry?

Tags:

registry

com

I got some COM components (DLLs) registered on my machine, however the DLLs associated these COM components were deleted (so I can't use regsrv32). How can I clean up my registry of these old COM components. I wonder if there is a tool that list what's registered and allow me to remove components I know are no longer used.

like image 768
user80855 Avatar asked Dec 05 '25 05:12

user80855


1 Answers

  1. Easy way - oleview.exe from Win SDK - look to Registry tab. on my machine it is here: "C:\Program Files (x86)\Windows Kits\8.0\bin\x64\oleview.exe" It's part of Visual Studio installation. Or you can download it separately for free: Win7 SDK It will show you all registry entries related to registered component - then delete them manually with regedit.exe

  2. manually (you can register COM class not only as the local machine level but also at the user level, and so you should be very careful as the HKCR is a merged view of HKLM\Software\Classes key and HKCU\Software\Classes key.):

    • Search registry by name of your DLL in HKCR (for example: HKEY_CLASSES_ROOT\CLSID{9B208FF8-F6B0-4290-94DE-7A4E857D8C4A}\InprocServer32) where GUID will correspond to your coclass CLSID. let it be GUID_A.
    • Then search by GUID_A and delete other entries (they are optional):
    • ProgID like HKEY_CLASSES_ROOT\YourServerName.YourCoclassName\CLSID = {GUID_A},
    • TypeLib in HKEY_CLASSES_ROOT\TypeLib\ {GUID_A}.
    • HKEY_CLASSES_ROOT\AppID\ {APPIDGUID} where {APPIDGUID} can be extracted from CLSID entry in bullet step 1.
    • HKEY_CLASSES_ROOT\Interface{IID}. Used for marshalable interface - To find it you can use CLSID of inproc server (another) that implements proxy, stub for this interface. I hope your COM server has no marshalable interfaces.