Unfortunately this method converts .ocx and .dll registering files into "DOS" format (8chars for name + 3 for extension) if the name is long...
I could not find an automation method to keep registered components in Window's format
Just copy the following text (starting at REGEDIT4), save it as a .reg file, and double click on it.
; regsvr.reg, Copyright (c) 1997-1998, Chris Sells.
; All rights reserved. NO WARRANTIES ARE EXTENDED. USE AT YOUR OWN RISK.
; P.S. Enjoy and send comments to firstname.lastname@example.org.
; Replaced %1 with %L to get long file name support.
; (Thanks to Sergey Tetkin <SergeyT@vest.msk.ru> for the suggestion!)
; Sometime in early 1997: 1st release
; Don, Tim, Keith and I were sitting around at a GCOM talking about
; what a pain it was to perform self-registeration and couldn't I
; add a shell extension to augment the context menu (I had written
; the Win95 course)? I said I could do even better than that and
; this regfile was born.
; Register and Unregister DLLs and OCXs
[HKEY_CLASSES_ROOT\dllfile\shell\Register COM Server\command]
[HKEY_CLASSES_ROOT\dllfile\shell\Unregister COM Server\command]
@="regsvr32 /u \"%L\""
; Register and Unregister EXEs
[HKEY_CLASSES_ROOT\exefile\shell\Register COM Server\command]
[HKEY_CLASSES_ROOT\exefile\shell\Unregister COM Server\command]