Solved

How to unregister an ocx

Posted on 2001-06-13
7
555 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

746 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

14 Experts available now in Live!

Get 1:1 Help Now