Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - VB Script Trying to use Capicom

Reply
 
Old 08-01-2008   #1 (permalink)
mark4asp


 
 

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




My System SpecsSystem Spec
Old 08-25-2008   #2 (permalink)
alovaal


 
 

Re: VB Script Trying to use Capicom

On 1 elo, 18:20, "mark4asp" <mark4...@xxxxxx> wrote:
Quote:

> 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
Try regsrv32 capicom.dll
My System SpecsSystem Spec
Old 08-25-2008   #3 (permalink)
alovaal


 
 

Re: VB Script Trying to use Capicom

On 25 elo, 14:56, alov...@xxxxxx wrote:
Quote:

> On 1 elo, 18:20, "mark4asp" <mark4...@xxxxxx> wrote:
>
>
>
>
>
Quote:

> > 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.
>
Quote:

> > I have independently tested the changes and they work.
>
Quote:

> > The original function is broke.
>
Quote:

> > The error message I get is:
>
Quote:

> > error loading DLL 'crypt.Algorithm'
>
Quote:

> > It breaks on the line "crypt.Algorithm = 3"
>
Quote:

> > 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.
>
Quote:

> > How to I test whether Capicom is actually there and test what
> > functionality is available from it?
>
Quote:

> > Function Hash(filename)
> > * * * * Dim crypt: Set crypt = CreateObject("CAPICOM.HashedData")
>
Quote:

> > * * * * ' CAPICOM_HASH_ALGORITHM_MD5
> > * * * * crypt.Algorithm = 3
>
Quote:

> > * * * * Dim stream: Set stream = CreateObject("ADODB.Stream")
> > * * * * stream.Type = 1 ' adTypeBinary
> > * * * * stream.Open
> > * * * * stream.LoadFromFile filename
>
Quote:

> > * * * * Do Until stream.EOS : crypt.Hash stream.Read(1024000) :Loop
>
Quote:

> > * * * * Hash = crypt.Value
> > End Function
>
> Try regsrv32 capicom.dll- Piilota siteerattu teksti -
>
> - Näytä siteerattu teksti -
D'oh
regsvr32 not regsrv32
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Old CAPICOM Update received? Windows Updates
CAPICOM UPDATE KB 931906 Vista General
capicom update PowerShell
Security update for Capicom (KB931906) hangs-up Updates Vista performance & maintenance
an update [suspect capicom] messed up ie7 on Vista Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46