|
VB Script Trying to use Capicom I had a script which used Capicom to calculate a MD5 hash for a file
and compare that to the files previous hash (calculated before network
transmission). The server it was on was rebuilt and some changes were
made to the script.
I have independently tested the changes and they work.
The original function is broke.
The error message I get is:
error loading DLL 'crypt.Algorithm'
It breaks on the line "crypt.Algorithm = 3"
I installed Capicom and gave Everyone full access to it. That hasn't
solved the problem. The code below is actually copied from the Capicom
examples.
How to I test whether Capicom is actually there and test what
functionality is available from it?
Function Hash(filename)
Dim crypt: Set crypt = CreateObject("CAPICOM.HashedData")
' CAPICOM_HASH_ALGORITHM_MD5
crypt.Algorithm = 3
Dim stream: Set stream = CreateObject("ADODB.Stream")
stream.Type = 1 ' adTypeBinary
stream.Open
stream.LoadFromFile filename
Do Until stream.EOS : crypt.Hash stream.Read(1024000) : Loop
Hash = crypt.Value
End Function |