There are tips available on the Web on how to add the Register and Unregister commands in the context menu for DLL and OCX file types. The option is quite handy, instead of us having to manually type the regsvr32.exe command line. But what if you’re using Windows Vista?

In Windows Vista with User Account Control (UAC) enabled, you require to elevate a task whenever a system-wide operation is to be carried out. Registering system DLLs from a non-elevated state may cause an error. For example, try to register the system module JScript.dll from Start, Search box (i.e. without elevating it). You’re sure to see the error 0x80004005 (ACCESS IS DENIED) when you do so.

Whereas, registering the DLL from an elevated Command Prompt window should work fine:

Register DLLs Elevated Using the Context Menu

To add the Register command in the context menu that’ll run the Regsvr32.exe command under elevated rights, you need to use the runas verb. Here is a REG file that I created, adds the runas verb for DLL and OCX file types in the following registry keys:

HKEY_CLASSES_ROOT \ Dllfile \ runas
HKEY_CLASSES_ROOT \ Ocxfile \ runas

1. Download the file register_runas.reg and save to Desktop.

2. Right-click on the file and choose Merge.

3. Click Yes when you’re asked for confirmation.

You should now see the Register (as Administrator) command in the right-click menu for DLL and OCX file types.

More Information

To recollect things, we’ve referenced runas in these articles:

Likewise, the runas verb can be used with any file type.

Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

One Comment

  1. S In Houston
    said this on Wednesday, May 2nd 2012 12:37 am

    This is great…. but how do I also add the “Unregister (As Admin)” option to the same right click menu?

Leave a Reply