Home > How-To Library > System & API

How to Register/unRegister the DLL/OCX programmatically

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
Public Sub RegComponent(ByVal ComName As String, ByVal sRegister As String) Shell ("Regsvr32 " & ComName & sRegister) End Sub 'How can I call this function: 'Call RegComponent(sExePath & "\Report.dll", " /u /s") 'Call RegComponent(sExePath & "\Report.dll", " /s") 'Call RegComponent(sExePath & "\Mscal.ocx", " /u /s") 'unregister 'Call RegComponent(sExePath & "\Mscal.ocx", " /s") 'register, "/s" - silent switch mode 'NOTE: You can manually register a component by going to START | RUN and 'typing in "Regsvr32.exe" and the name of component -- in quotes, full path, 'as string. For example: Regsvr32.exe "C:\Windows\System32\mscomctl.ocx"

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.