Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to unregister an ocx

Posted on 2001-06-13
7
Medium Priority
?
573 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 200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

598 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