[RESOLVED] Remove dead COM entries in the registry.
I want to ask the VB6 community a question. How do you guys deal with dead COM entries? What I mean is, there might be some times where you register a COM server for a VB6 application which you may later move to a different folder or delete entirely but the COM entries for the classes and interfaces still remain in the registry but they now point to a type library or DLL that no longer exists. I don't know about most people but I tend to do a fresh re-install of Windows every few years so what tends to happen is that this practice pollutes the registry with dead COM data that references all kinds of DLLs and type libraries that no longer exist. I learned to live with it when I was still heavy into VB6 but I never thought to ask until now how others deal with this issue.
Do you guys know of any tool that can scan the registry and remove invalid COM entries or is it just something we have to live with?
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
why bother?
a leftover will not do anything until u need it, and when u do, it will tell u that something is not right and u can re-register.
Yes, it does no harm which is why I was able to live with it. However issues can come up if you move things around and delete things and forget to deal with the registry. Plus, I'm a bit OCD. I like things neat and ordered where ever possible. Having a bunch of invalid registry entries harasses my OCD lol. I'm always moving folders around and deleting stuff and sometimes I break VB6 COM applications this way because I registered something is some temp folder somewhere a few years back and forgot about it.
Originally Posted by Eduardo-
And from time to time run a registry cleaner.
I use an old version of Advanced SystemCare (version 9).
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
I have been thinking about "that", what is the best way to deal with typelibs and such.
one solution is to put everything in one folder, lets call it C:\VB6\TYPELIBS\ and -"-\OCX\
that should help with any OCD needs and u will always know where they are.
I have been thinking about "that", what is the best way to deal with typelibs and such.
one solution is to put everything in one folder, lets call it C:\VB6\TYPELIBS\ and -"-\OCX\
that should help with any OCD needs and u will always know where they are.
That's actually a good suggestion and it is something I have practiced in the past. I used to keep all the personal libraries I wrote in one place.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
after installing and configuring a fresh system I take a snapshot of it in its fully configured state with a tool like acronis/macrium etc.
if windows ever acts up just revert to the fresh snapshot can be done in like 15 minutes and you have a completely clean and configured machine just the way you left it.
no need to worry about trying to manage all the COM reg entries from uninstalls or recompiles etc
On a "sensitive" machine, after a clean install, setup of apps/programs, and everything runs like it's supposed to do, i do a backup of the disk (!!) with CloneZilla.
So i get my partition layout, swap etc. back without turning one knob.
Also nice for quick distribution of an installation.
Just change the hostname, (and if it applies static IP-Address). Run. Have Fun
EDIT: For quick distribution i also use the "dd"-command from Unix. two years ago i set up 4 identical machines with that within 30 Minutes total (Manjaro with Cinnamon-Desktop)
Last edited by Zvoni; Nov 23rd, 2021 at 02:43 AM.
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
Here is an internal tool we are using on our build servers. It's pretty shoddy but gets the job done.
You can use it to review the junk in COM registrations after IDE crashes, double registrations, compilations with Project compatibility even system components have stale registrations after Windows upgrade.
Just don't use the Delete button unless you know what you're doing or risk screwing your registry beyond recovery. (Btw, never knew how to take backup of the registry so never did one.)
*snipp*
(Btw, never knew how to take backup of the registry so never did one.)
cheers,
</wqw>
Huh?
Open Reg-Editor, right-click on "Computer" (upper left corner in left window, It's the root of the TreeView) --> Export
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
I wouldn’t dare trying to backup and restore the entire registry like that just select (small) portions. I would imagine some keys are locked from tampering and permission issued and stuff in use or accessed while being written.
Machine would have be offline and partition accessed with a boot disk or something then just copy the raw hive files but still dicey.
The closest to actual backup/restore comes the built-in REG utility
Code:
D:\TEMP>reg save /?
REG SAVE KeyName FileName [/y] [/reg:32 | /reg:64]
KeyName ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY.
FileName The name of the disk file to save. If no path is specified, the
file is created in the current folder of the calling process.
/y Force overwriting the existing file without prompt.
/reg:32 Specifies the key should be accessed using the 32-bit registry view.
/reg:64 Specifies the key should be accessed using the 64-bit registry view.
Examples:
REG SAVE HKLM\Software\MyCo\MyApp AppBkUp.hiv
Saves the hive MyApp to the file AppBkUp.hiv in the current folder
D:\TEMP>reg restore /?
REG RESTORE KeyName FileName [/reg:32 | /reg:64]
KeyName ROOTKEY\SubKey (local machine only)
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key to restore the hive file into.
Overwrites the existing key's values and subkeys.
FileName The name of the hive file to restore.
You must use REG SAVE to create this file.
/reg:32 Specifies the key should be accessed using the 32-bit registry view.
/reg:64 Specifies the key should be accessed using the 64-bit registry view.
Examples:
REG RESTORE HKLM\Software\Microsoft\ResKit NTRKBkUp.hiv
Restores the file NTRKBkUp.hiv overwriting the key ResKit
Unfortunately it cannot backup a hive in use
Code:
D:\TEMP>reg save HKLM d:\temp\backup-hklm.hiv
ERROR: Access is denied.
So even in 2021 easiest is to use 3-rd party utilities to backup registry while the OS is running (using VSS) like this one: RegBak
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
Actually registry is stored in a JET database (several MDB files) but unfortunately you cannot reliably copy these while the database is in use (while the OS is running).
You have to either boot in Recovery Console to copy the contents of C:\Windows\System32\Config folder to a backup folder while files are not in use or use Volume Shadow Copy to snapshot a consistent state of the database while the OS is running.
I gave this a try and while it can find invalid COM entries, it cannot remove them. It just fails with errors. I tried to figure out why but I eventually gave up.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Here is an internal tool we are using on our build servers. It's pretty shoddy but gets the job done.
You can use it to review the junk in COM registrations after IDE crashes, double registrations, compilations with Project compatibility even system components have stale registrations after Windows upgrade.
Just don't use the Delete button unless you know what you're doing or risk screwing your registry beyond recovery. (Btw, never knew how to take backup of the registry so never did one.)
cheers,
</wqw>
This is a neat little program. However, I can't seem to delete invalid entries using this either. I assumed that when I clicked the Invalid i/s button it would show me a list of invalid entries but it didn't. As far as I can tell it has no effect. Interesting little program though.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
after installing and configuring a fresh system I take a snapshot of it in its fully configured state with a tool like acronis/macrium etc.
if windows ever acts up just revert to the fresh snapshot can be done in like 15 minutes and you have a completely clean and configured machine just the way you left it.
no need to worry about trying to manage all the COM reg entries from uninstalls or recompiles etc
Macruim makes extremely top notch software. I'm familiar with Reflect.
Also, what about Windows restore points? Couldn't this work for restoring Windows to a previously stable point?
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
I also gave this a try, although I installed version 15 instead of 9. This also didn't work. It has a whole bunch of features I didn't want and it also put a bunch of annoying popups and widgets on my computer. To top it off the registry cleaner looked like it worked, yet after it said everything was cleaned out, the dead entries were still present after. I got scammer vibes from this software. It reminds me of software you used to find on old Warez sites that promise to boost your PC's speed by insane percentages but really they were just platforms for adware.
I'm not saying this one is such a thing because obviously you wouldn't recommend it if it didn't work for you. That's just the vibe I got.
Anyways, I think the old adage applies here, "when you want something done right, do it yourself". At some later date I think I'll study the cleaner code wqweto posted and write something similar in .Net.
Thanks everyone for your responses. I'm marking this resolved now.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Re: [RESOLVED] Remove dead COM entries in the registry.
Personally, unless I think I'm having some kind of performance issue, I don't mess with it ... and I'm scared to death of those registry "cleaner" utilities.
I can easily see a situation where those "cleaners" don't know exactly what they're doing and delete something that's important, possibly breaking something that will possibly cause you many hours of agony to get sorted.
This takes me back to my very long ago DOS days. On my IBM-XT, I remember being insistent upon knowing what every single file on my computer was doing. (Didn't have a registry to worry about.) When Windows 3.1 came along, I was still of that mindset, and still had a pretty good handle on it. However, probably around Win95 or maybe Win98, I realized that this was just no longer a possibility, and eventually let go of it. I'm pretty much the same way about the registry ... there's all kinds of crap in there about which I have no clue, but that's just the world we live in.
And then, we can push forward to the dawn of quantum computers, where not even the original programmers know what everything is doing.
Ohhh, I recently heard a nice joke (probably old, but I just heard it).
Guy walks into a bookstore and asks for a book on Pavlov and Schrödinger. Owner says, "it rings a bell but I'm not sure if it's here or not".
Last edited by Elroy; Nov 24th, 2021 at 07:19 PM.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Re: [RESOLVED] Remove dead COM entries in the registry.
Originally Posted by Elroy
Personally, unless I think I'm having some kind of performance issue, I don't mess with it ... and I'm scared to death of those registry "cleaner" utilities.
I can easily see a situation where those "cleaners" don't know exactly what they're doing and delete something that's important, possibly breaking something that will possibly cause you many hours of agony to get sorted.
Yea. This is always a scary possibility. But I'm not opposed to nuking my system in the pursuit of knowledge as long as actual files don't get deleted. I don't mind doing complete re-installs. There were times in my past where I did multiple re-installs in a single night trying to fix one issue or another.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
Also, what about Windows restore points? Couldn't this work for restoring Windows to a previously stable point?
I always turn off windows restore points I hate them. They are slow and seem to slow down system performance and I just don’t trust them. Also malware frequently wipes them.
I always turn off windows restore points I hate them. They are slow and seem to slow down system performance and I just don’t trust them. Also malware frequently wipes them.
Ah ok. I've never used it but I've always wanted to try it. I didn't know it was this problematic.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber
I always turn off windows restore points I hate them. They are slow and seem to slow down system performance and I just don’t trust them. Also malware frequently wipes them.
I find them very useful, any time that I'm going to do something that I'm not sure if I will be able to undo, I make a restore point.
It allowed me to go back to a good Windows state many times.
I don't think that would impact in any Windows performance out of that time when do are making a new restore point (it takes seconds, BTW). Anyway they take some disk space, not a lot but some (of course).
PS: the problem with restore points that I see is that they are limited in time, Windows automatically deletes them after a couple of weeks (or so).
Last edited by Eduardo-; Nov 24th, 2021 at 11:57 PM.
I assumed that when I clicked the Invalid i/s button it would show me a list of invalid entries but it didn't.
The UI is abhorent. You first have to Scan your current registry (into an MDB). Then you can filter typelibs/CLSIDs by C:\Work\MyProject folder (or project name) and delete these (with Invert + Delete).
Invalid interfaces (a SQL query) lists interfaces from missing typelibs (which you can Invert + Delete too). Usually you get a lot of temp VB6 entries left from crashed debug sessions.
At least you can explore the state of the three main registry keys containing local COM registrations.
The unfortunate state of affairs is that regtlib.exe (and VB6 IDE) *cannot* unregister typelibs. There is no /u switch (like in regsvr32.exe) because there is no API call for unregistration.
Re: [RESOLVED] Remove dead COM entries in the registry.
I did use cleaners in "xp" days.
after installing windows7 many years ago it still work great, no strange performance issues or annoying popup telling me this and that.
I think the reason is:
- I use SSD, they give you less headaches than HDD.
- I don't install tons of crap softwares all the time. I have what I need and seldom need something new and if so, Im more careful with what I install.
- I don't use OCX for my project, so no need to do any installations.
I think, if you need registry cleaners you are not doing a good job with your windows.
as I wrote before, if you are creating your own OCX/Typelibs or using a OCX/Typelib from someone else, create a folder where u will have all those.
don't just download, put in some random folder, install, forget, delete folder (without unregister first) and theres a entry in the registry (a leftover)
also, the registry is like a library. you don't need to remove a book you are not using, or if the book is gone for some reason, you can "get it again" or simply let the register of that book just be, it will not do much.
if you instead have messed up and a tool is not working properly. well. re-install.
I would avoid cleaners. they don't know 100% if you are using something or not.
I remember that in XP, they didnt help much those registry cleaners, and eventually the only solution was to install a new OS anyway.
Re: [RESOLVED] Remove dead COM entries in the registry.
Originally Posted by wqweto
The UI is abhorent. You first have to Scan your current registry (into an MDB). Then you can filter typelibs/CLSIDs by C:\Work\MyProject folder (or project name) and delete these (with Invert + Delete).
Invalid interfaces (a SQL query) lists interfaces from missing typelibs (which you can Invert + Delete too). Usually you get a lot of temp VB6 entries left from crashed debug sessions.
At least you can explore the state of the three main registry keys containing local COM registrations.
The unfortunate state of affairs is that regtlib.exe (and VB6 IDE) *cannot* unregister typelibs. There is no /u switch (like in regsvr32.exe) because there is no API call for unregistration.
cheers,
</wqw>
Ah ok. Sounds like you guys put this together in a hurry. Might be an interesting project to do a fully functional version with everything working proper and easy to use.
Originally Posted by baka
I think, if you need registry cleaners you are not doing a good job with your windows.
Nah. That's not it, at least not for me. I don't install a bunch of garbage on my computer. I'm strict about that. Thing is though, my PC goes years without fresh re-installs so what tends to happen over time is I end up with a lot of rubbish in the registry, especially when I install, write or test various VB6 programs over the years. I often end up deleting folder or moving stuff where COM DLLs/OCXs are registered. I just think it would be nice when I'm writing any VB6 code that involves adding references for invalid references to not show up. It's not a huge deal but I do find it annoying sometimes when adding a typelib to a project, that the IDE complains that the file doesn't exist and then I have to re-register it in a new location. Sometimes I might want to use a new version of whatever and I want the old one gone.
All in all, it's a minor annoyance that I've learned to live with. But like I said, I tend to want things nice and neat whenever I think it could be helped.
C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter
There's just no reason to use garbage like InputBox. - jmcilhinney
The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber