• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3817
  • Last Modified:

REGSVR32.EXE command line options clarified please

Hi Experts

Could somebody please explain to me the differences between using RegSvr32 without a switch to "register" a DLL file, and using it with the /i switch.  I'm unclear of exactly what the /i does and what kind of other command line parameters may be used with it, eg. to copy the DLL to a given folder and then register it in situ.

Explanation of Regsvr32 usage and error messages


RegSvr32.exe has the following command-line options:
Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u - Unregister server
/i - Call DllInstall passing it optional [cmdline] (/i /u calls dll uninstall)
/n - do not call DllRegisterServer (must be used with /i)
/s  Silent (added with Windows XP and Windows Vista)

DllRegisterServer and Unregister server (/u) seem to be "registering" and "unregistering" a DLL, but how does that differ from DllInstall and DllUnInstall?

The reason I'm asking is that I found a page of "fixes" for Windows 98 which involved re-registering various DLLs to restore the Explorer Shell and various other things like IE and OE.  I expected them just to show eg.   RegSvr32 shell32.dll, but instead they show  RegSvr32 /i shell32.dll.

Thanks in advance.
2 Solutions
The difference here is that the - optional - 'DllInstall()' function (http://msdn2.microsoft.com/en-us/library/bb759846.aspx) *can* take arguments. Usually, the mandantory 'DllRegisterServer()' function (http://msdn2.microsoft.com/en-us/library/ms682162(VS.85).aspx) is called by regsvr32.exe. If '/i' is used and *no* arguments are passed as above, that is equivalent to a plain 'RegSvr32 shell32.dll'
DllRegisterServer must be implemented if the DLL is a server of COM objects. If not, DllInstall only is used .
BillDLAuthor Commented:
Thank you guys, that explains it well.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now