Click to See Complete Forum and Search --> : [Tip] Register/Unregister DLLs and OCXs easily


mendhak
Oct 15th, 2003, 07:02 AM
Instead of having to do a


regsvr32 "c:\whatever\something.dll"


for each dll you need to register, it's easier to have a "Register/Unregister" option in the right click menu for DLLs.

Create a reg file, and add the following to it:


REGEDIT4

[HKEY_CLASSES_ROOT\dllfile\Shell]
@="Register"

[HKEY_CLASSES_ROOT\dllfile\Shell\Register]

[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="regsvr32.exe %1"

[HKEY_CLASSES_ROOT\dllfile\Shell\Unregister]

[HKEY_CLASSES_ROOT\dllfile\Shell\Unregister\command]
@="regsvr32.exe /u %1"

[HKEY_CLASSES_ROOT\.ocx]
@="ocxfile"

[HKEY_CLASSES_ROOT\ocxfile]
@="OCX File"
"EditFlags"=hex:00,00,01,00

[HKEY_CLASSES_ROOT\ocxfile\Shell]
@="Register"

[HKEY_CLASSES_ROOT\ocxfile\Shell\Register]

[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="regsvr32.exe %1"

[HKEY_CLASSES_ROOT\ocxfile\Shell\Unregister]

[HKEY_CLASSES_ROOT\ocxfile\Shell\Unregister\command]
@="regsvr32.exe /u %1"



Then, run the .reg file, and the next time you right click a DLL or OCX, the option to register or unregister it should be there. Note that "Register" becomes the default option in the right click menu when you run the .reg file.

I found this useful, and thought I'd share it with all of you here. :)

Tek
Oct 15th, 2003, 07:10 AM
Thx this will save lots of time lol.

mendhak
Oct 15th, 2003, 08:48 AM
Micro$oft should've included this behavior by default, me thinks. :cool:

JPicasso
Oct 15th, 2003, 10:25 AM
Who says no good code comes out of Ulaan Baator?

kleinma
Oct 15th, 2003, 10:56 AM
thanks mendhak... now get back to chit-chat where you belong :D

satti charvak
Oct 15th, 2003, 11:16 AM
do you have any leg problems......coz all people who have mendhak as nickname do have leg problems......all though thay have excellent ideas to leap around.......

good help boss for ocx registration..

mendhak
Oct 15th, 2003, 11:40 PM
Originally posted by JPicasso
Who says no good code comes out of Ulaan Baator?

*raises hand*

jemidiah
Oct 15th, 2003, 11:54 PM
Are you really from Mongolia then?

MartinLiss
Oct 15th, 2003, 11:58 PM
mendhak: Would you like me to m ove this thread to the CodeBank?

mendhak
Oct 16th, 2003, 12:34 AM
Your discretion Martin. If you see it fit to move it there, go ahead. :)

mendhak
Oct 16th, 2003, 12:42 AM
Or should I create a copy of this in Code Bank - Other so that some of the members can see this here too?

binduau
Oct 16th, 2003, 02:08 AM
Awesome Tip

:lol:

bindu

Originally posted by mendhak
Instead of having to do a


regsvr32 "c:\whatever\something.dll"


for each dll you need to register, it's easier to have a "Register/Unregister" option in the right click menu for DLLs.

Create a reg file, and add the following to it:


REGEDIT4

[HKEY_CLASSES_ROOT\dllfile\Shell]
@="Register"

[HKEY_CLASSES_ROOT\dllfile\Shell\Register]

[HKEY_CLASSES_ROOT\dllfile\Shell\Register\command]
@="regsvr32.exe %1"

[HKEY_CLASSES_ROOT\dllfile\Shell\Unregister]

[HKEY_CLASSES_ROOT\dllfile\Shell\Unregister\command]
@="regsvr32.exe /u %1"

[HKEY_CLASSES_ROOT\.ocx]
@="ocxfile"

[HKEY_CLASSES_ROOT\ocxfile]
@="OCX File"
"EditFlags"=hex:00,00,01,00

[HKEY_CLASSES_ROOT\ocxfile\Shell]
@="Register"

[HKEY_CLASSES_ROOT\ocxfile\Shell\Register]

[HKEY_CLASSES_ROOT\ocxfile\Shell\Register\command]
@="regsvr32.exe %1"

[HKEY_CLASSES_ROOT\ocxfile\Shell\Unregister]

[HKEY_CLASSES_ROOT\ocxfile\Shell\Unregister\command]
@="regsvr32.exe /u %1"



Then, run the .reg file, and the next time you right click a DLL or OCX, the option to register or unregister it should be there. Note that "Register" becomes the default option in the right click menu when you run the .reg file.

I found this useful, and thought I'd share it with all of you here. :)

Spajeoly
Oct 16th, 2003, 02:59 AM
What I did was just right click on one > Open With, Select Regsvr32.exe and select to always open this type of file with this program.

But good tip.

jeremy_ckw
Oct 16th, 2003, 05:25 AM
Heh...:) How do I undo this? Just delete all the registry entries?

mendhak
Oct 16th, 2003, 05:28 AM
Nope. You're stuck with it forever now! Mwahah!! :evil:











































Yeah, just delete the registry entries.

jeremy_ckw
Oct 16th, 2003, 05:31 AM
Originally posted by mendhak
Nope. You're stuck with it forever now! Mwahah!! :evil:











































Yeah, just delete the registry entries.

Very funny...hahahha....well...thanks for the great tips, mate!

kleinma
Oct 16th, 2003, 10:16 AM
too bad theres not a way to only have it show on files that can actually be registered/unregistered instead of all DLLs

crptcblade
Oct 16th, 2003, 07:26 PM
Originally posted by kleinma
too bad theres not a way to only have it show on files that can actually be registered/unregistered instead of all DLLs

That's not really true, its just a lot harder to accomplish.

http://www.vbforums.com/showthread.php?s=&threadid=190107
http://www.vbforums.com/showthread.php?s=&threadid=242824

mendhak
Oct 17th, 2003, 12:17 AM
Whoops.

Got kicked so hard it duplicated itself. :ehh:

Madboy
Jan 21st, 2004, 12:02 PM
Does it matter where you put this registry key in the registry?

CornedBee
Jan 26th, 2004, 10:01 AM
On 2k and XP you can put it in
HKEY_LOCAL_MACHINE/Software/Classes
so that every user has it, or in
HKEY_CURRENT_USER/Software/Classes
so that only you have it.

But the stuff mendhak posted automatically places itself in
HKEY_CLASSES_ROOT
so I don't know which case applies.


It would be possible to associate this stuff only with DLLs that CAN be registered, I could even write something like it. Question is, do I care?

Madboy
Jan 26th, 2004, 12:26 PM
So i can pop it in anywhere?:confused:

CornedBee
Jan 26th, 2004, 12:31 PM
As mendhak said, put this stuff into a .reg file. It will know where to place itself.

Madboy
Jan 26th, 2004, 12:32 PM
Where do you get the .reg files from though? They aint in any of my windows context menu's

CornedBee
Jan 26th, 2004, 12:54 PM
Fire up notepad, copy and paste the code from here and save as a .reg.

Madboy
May 4th, 2004, 09:36 AM
Cheers dude:wave:

csar
May 21st, 2004, 10:54 PM
It should have quote sign " around %1 to ignore the error when dll file was stored in directory that had space in name.


regsvr32.exe %1

,should be this

regsvr32.exe "%1"


lol