Solved

How to unregister an ocx

Posted on 2001-06-13
7
560 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
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now