by Murali Bala (7 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 8th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Register & Unregister COM Components using VB
Dim sDLLPath As String
sDLLPath = "c:\WINNT\MyDLL.dll"
'or
sDLLPath = "c:\WINNT\MyDLL.oCX"
Shell "regsvr32 " & sDLLPath
' To Register a DLL in Silent Mode use '-s ' Switch
Shell "regsvr32 -s " & sDLLPath
'To Unregister a DLL, use the -u switch
Shell "regsvr32 -u " & sDLLPath
'To Unregister a DLL, use the -u switch in Silent Mode use -s switch
Shell "regsvr32 -u -s " & sDLLPath
End Sub