Solved

How to unregister an ocx

Posted on 2001-06-13
7
565 Views
Last Modified: 2012-06-21
I'm testing an app on a machine and I need to unregister an ocx in order to test my app.  I need to know how it will behave with the ocx not being registered.  I've tried KB but there aren't any good samples of how to use the switches.  I know ytou have to use the /u but what is the correct syntax?

KB showed a sample like this: [/u[:c:\windows\system]]comctl32.ocx
This makes no sense to me.

does anyone know how to do this and test to see if infact that ocx is unregistered?

0
Comment
Question by:SE081398
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 1

Accepted Solution

by:
BartonM earned 50 total points
ID: 6189672
Hello,

The syntax for unregistering is:

regsvr32 /u "C:\WinDir\SystemDir\OcxName.ocx"

In Access you can see if an ocx is registered in
Tools->References (only available when you have a module opened) or if it is a control in Tools->ActiveX Controls.

BartonM
0
 
LVL 1

Expert Comment

by:CJHarrap
ID: 6189838
or...
if the OCX is a web one, e.g an intranet ActiveX control, go to C:\windows\downloaded programs\ find the OCX control you want, then right click and choose remove or update...

Cheers,

CJ.
0
 
LVL 1

Expert Comment

by:CJHarrap
ID: 6189847
or...
if the OCX is a web one, e.g an intranet ActiveX control, go to C:\windows\downloaded programs\ find the OCX control you want, then right click and choose remove or update...

Cheers,

CJ.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:cjswimmer
ID: 6190717
here is a great trick that has saved me tons of time.  If you are using WinNT, open Notepad and enter the following text exactly:

REGEDIT4
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="C:\\WINNT\\SYSTEM32\\Regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\Unregister\command]
@="C:\\WINNT\\SYSTEM32\\Regsvr32.exe /u \"%1\""
[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="C:\\WINNT\\SYSTEM32\\Regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\dllfile\Shell\Unregister\command]
@="C:\\WINNT\\SYSTEM32\\Regsvr32.exe /u \"%1\""

now save the file as 'OCX_DLL_Reg.reg'

double click the file after you save it and you will get a message saying the information has been entered into the registry.  now whenever you right click on a DLL or OCX file, you will see an entry in the pop-up list to REGISTER ir UNREGISTER the file.  You can also make another file with the following if you are using Win98 (or 95, ME etc.)

REGEDIT4
[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="C:\\WINDOWS\\SYSTEM\\Regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\ocxfile\Shell\Unregister\command]
@="C:\\WINDOWS\\SYSTEM\\Regsvr32.exe /u \"%1\""
[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="C:\\WINDOWS\\SYSTEM\\Regsvr32.exe \"%1\""
[HKEY_CLASSES_ROOT\dllfile\Shell\Unregister\command]
@="C:\\WINDOWS\\SYSTEM\\Regsvr32.exe /u \"%1\""

I saved this as '98_OCX_DLL_Reg.reg'. I have both of these saved in a shared dir so I can double click them from client machines for fast reg and dereg actions depending on which system they are running.


hope this helps - cjswimmer
0
 
LVL 3

Author Comment

by:SE081398
ID: 6191461
Thanks that's what I was looking for.  I was doing everything similar to that but after the 50th attempt I lost my patience.  Jswimmer has a good idea too.
0
 
LVL 3

Author Comment

by:SE081398
ID: 6191486
cjswimmer that's a good idea.  I'd like to award 50 points cuz I believe I will use you idea for somthing else.  I will leave a Q "points for Cjswimmer" thanks.

0
 
LVL 6

Expert Comment

by:cjswimmer
ID: 6191501
[/u[:c:\windows\system]]comctl32.ocx

to explain the syntax, everything encapsulated in a square bracket is optional
[/u] is optional (but necessary in order to unregister)
[c:\windows\system] is optional, but you must put a different path if you are trying to affect a file in a differet location than this default value
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

735 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