Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Apr 15, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Register and unregister components with context menus

The stardard method to register and unregister ActiveX component is running the REGSVR32 utility, which forces you to bring up the Start|Run dialog and manually type the command line. A much better approach is to have the Register and Unregister commands right in the context menu that appears when you right-click a DLL, EXE, or OCX file in the Explorer window.

To create these menu commands, copy the following text to the clipboard, paste it into an editor (such as Notepad) and save it to a file with a .reg extension, such as ActiveX.Reg. Then double-click the file, and voila!, you'll be able to register and unregister all types of ActiveX components by right-clicking on them.

Note that the .reg file below assumes that the REGSVR32.EXE utility is your system path, so that it can be run without specifying the complete path. If this is not the case you should move it to the main Windows directory (e.g. C:\WINDOWS or C:\WINNT) or you should provide the complete path in all the lines of the .reg file that reference it.

Start of the REG file


; ActiveX DLLs


@="Register ActiveX DLL"

@="regsvr32.exe \"%L\""

@="Unregister ActiveX DLL"

@="regsvr32.exe /u \"%L\""

; ActiveX Controls


@="Register OCX Control"

@="regsvr32.exe \"%L\""

@="Unregister OCX Control"

@="regsvr32.exe /u \"%L\""

; ActiveX EXEs


@="Register ActiveX EXE"

@="\"%L\" /regserver"

@="Unregister Active EXE"

@="\"%L\" /unregserver"

End of the REG file
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date