20 April 2006

Register & Unregister a DLL from Windows Explorer

Back in my developer days when I was building DLLs and OCXs, I was constantly registering and unregistering DLLs using the command line (find me a dev who isn't a command line junkie - I still have two prompts open as I type this). As time's gone on, I submitted to using Windows Explorer more and more to do things and (this is going back many years), someone told me how to setup a shell extension to DLLs to allow you to register and unregister them directly. I guess I kept that file around all these years and it's useful to find it again now I'm installing test builds regularly. Hopefully, it's obvious how this works when you see the registry file below. Simply save as xyzzy.reg and merge it into the registry.

REGEDIT4
[HKEY_CLASSES_ROOT\.dll]
@="dllfile"
[HKEY_CLASSES_ROOT\dllfile\shell]
@="WIN_SYS"
[HKEY_CLASSES_ROOT\dllfile\shell\REG_32]
@="Register"
[HKEY_CLASSES_ROOT\dllfile\shell\REG_32\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]
@="dllfile"

Once you click on a DLL in Windows Explorer, you'll see two new options to Register and Unregister DLLs. Normal disclaimer applys about messing up your registry if you choose to use this etc.

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# MogBlog » Register & Unregister a DLL from Windows Explorer said:
PingBack from http://dancmorgan.wordpress.com/2006/04/20/register-unregister-a-dll-from-windows-explorer/
20 April 06 at 11:17 AM
# David Douglass said:
Something similar is to create a shortcut to regsvr32.exe and place it in your SendTo folder.  You can then register by pointing at a DLL/OCX and sending to regsvr32.exe.  You can also create an unregister shortcut simply by adding -u to the end of the target.
20 April 06 at 6:53 PM
# David Douglass said:
20 April 06 at 7:39 PM
# jhoward said:
David - should have thought of that. Already had for notepad....
Cheers,
John.
21 April 06 at 11:12 AM
# Ed said:
I needed to surround the %1 with double quotes ( "%1") or it wouldnt work for files that had a space in the path (e.g. Documents and Settings) - otherwise it's great!
09 June 06 at 9:31 AM
# http://blogs.technet.com/jhoward/archive/2006/04/20/425726.aspx said:

PingBack from http://frankthefrank.info/entry.php?id=kwws%3d22eorjv1whfkqhw1frp2mkrzdug2dufklyh253392372532758%3a591dvs%7b

05 April 08 at 9:55 AM
# unregister dll said:

PingBack from http://javiernews.201mb.com/unregisterdll.html

31 May 08 at 2:31 PM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 
Page view tracker