Solved

How to unregister an ocx

Posted on 2001-06-13
7
567 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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 Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

729 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