How to Register/unRegister the DLL/OCX programmatically
Posted on September 20, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 'System & API - How to Register/unRegister the DLL/OCX programmatically 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" |