The answer to my vote was for money, but I wanted to add a little to it. Here is an example of the code that I used for this very problem, maybe it can speed you up ...
// bind a variabe to WScript.Shell Set WshShell = CreateObject("WScript.Shell") // define the path to the regasm.exe file RegAsmPath = "c:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" // register the dll WshShell.run "cmd /c " & RegAsmPath & " c:\temp\cbsecurity.dll /codebase /nologo /s", 0, True // bind a variable to the dll Set cbUtil = CreateObject("CBSecurity.Utilities")
I have included the IsAlive method in the dll ...
Public Function IsAlive() As Boolean Return True End Function
... and can verify that it is correctly registered using the syntax:
//check if dll is available to your code msgbox "cbUtil is alive: " & cbUtil.IsAlive
Hope this helps someone ...
Dscoduc
source share