Solved

Invalid references / controls

Posted on 2001-06-26
10
185 Views
Last Modified: 2010-05-02
Hello,

Does anyone know of a way of removing invalid activex dll/exe/ocx 's from the registry ??

For example, say we create an activex control..

fred.ocx

we register it, then delete it... how do we unregister it ??

I know we should have unregistered it before deleting, but you know what users are like..

I've tried using registry cleaners in the past and ended up re-installing windows... so I don't fancy that route.

Ta
Smg.
0
Comment
Question by:smegghead
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6227104
Hi,

U can use the regsvr32.exe to do this:

To Register a dll/ocx: regsvr32 mydll.ocx

To Unregister a dll/ocx: regsvr32 /u mydll.ocx



0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6227106
smg, you should be able to go into the registry and locate the entry or entries for fred.ocx, it should be in HKEY_CLASSES_ROOT, you will find an entry of the form Fred.Fred with a ClsID key underneath it. Copy the class name from here and search the registry for it. You cann then remove that branch from the registry as well.
0
 
LVL 10

Author Comment

by:smegghead
ID: 6227129
ryancys,

I know how to unregister when the file still exists, but what I'm asking is how do we unregister if the file has been deleted.

Tim,

Are you aware of any s/w to do this ?? I don't like hacking around in the registry. I could write something myself, but time is a bit tight at the mo.

Smg.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 3

Accepted Solution

by:
sridhar_PJ earned 50 total points
ID: 6227156
Just try this tool
http://www.iolo.com/sm/regclean.cfm
Regards
Sridhar
0
 

Expert Comment

by:svandera
ID: 6228032
Unregistering DLL's and OCX's is no problem as long as you don't delete the file. You can simply use the command regsvr32.exe <filename.dll> /U

This is because as long as you have the DLL you can derive the GUID that uniquely identifies it, so its intry can be easely found in the Windows registry. So before you delete a DLL or other application extention don't forget to use regsvr32.

Should you however have deleted your application extention before you unregistered it. You can always remove it manually with regedit.exe. However this should be done with great caution since you can damage your system in the proces. Regedit has a search function that allows you to look for your application extention by it's progid. Simply do a search for "FRED.OCX" or so and it should find the entry. Once you're sure the entry is correct by inspecting the other information stored in the entry you can remove it.

There are some other tools that automate this registry cleenup procedure. But so far I haven't seen one that meets the needs of a programmer since they don't offer the detail of information you need.

0
 
LVL 3

Expert Comment

by:Hornet241
ID: 6228090
This is the manual way the get rid of the registry entries.

****  BACKUP THE REGISTRY  ****

1.  Start Regedit from the Start/Run
2.  Ensure 'My Computer' is highlighted(at top of registry)
3.  Select Edit/Find from the menu
4.  Search for Fred.ocx
5.  Delete all references to this file
(****  DELETE WHOLE KEYS ONLY WHEN THIS IS THE ONLY FILE ****)

There could be more than one entry so after deleting continue searching till a not found message appears
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6228104
svandera, please read the guideline on comments vs answers at the bottom of this page. Your answer duplicates existing comments and as such should not have been posted as an answer. I understand that you are new and can therefore be forgiven this once. However if you continue to post "answers" in this way your account will be referred to customer services for possible penalty.
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 6228816
svandera,
Welcome to Experts Exchange

 You will find that most experts here will generally post comments instead of answers
 in order to keep the question in the high traffic "questions awaiting answers" section.
 Locking a question is unfair to the person asking the question since it might not
 be seen by other experts who can add information to the question.
 There is no penalty to you, as the questioner can accept any comment as an answer.
 You don't see the accept comment as answer but the person posting the question can.
 Also, please note that an 'answer' is supposed to be 100% sure to fix the problem
 and doesn't duplicate a previous comment.  
 See the guidelines at the bottom of the page, and:
 http://www.experts-exchange.com/v3.0/statics/expertonly.html

This is why I am rejecting your proposed asnwer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 6228845
Forgot the part about

kb
Community Support Moderator
Experts Exchange
0
 
LVL 10

Author Comment

by:smegghead
ID: 6293027
Cool tool !!

Thanks everyone else too..
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 65
Spell Check in VB6 13 113
Child Form in front 4 47
How to read File Date Created using VB6 8 39
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question