We help IT Professionals succeed at work.

Running Ionic.Zip proc.

H-SC
H-SC asked
on
I have the following vbscript that I am trying to run and can't seem to get around the error
on line 5 that reads:

"ActiveX component can't create opject: 'Ionic.Zip.ZipFile'

I have placed the Ionic.Zip.dll into the sys32 directory and restarted my computer.
and still does not work.  Thanks for any help in advance.


dim filename
filename = "C:\ZipFile_1.zip"
WScript.echo("Instantiating a ZipFile object...")
dim zip
set zip = CreateObject("Ionic.Zip.ZipFile")
WScript.echo("Setting the encryption...")
zip.Encryption = 3
WScript.echo("setting the password...")
zip.Password = "This is the Password."
WScript.echo("adding a selection of files...")
zip.AddSelectedFiles "*.txt"
WScript.echo("setting the save name...")
zip.Name = filename
WScript.echo("Saving...")
zip.Save
WScript.echo("Disposing...")
zip.Dispose
zip = Nothing
WScript.echo("Done.")
Comment
Watch Question

Most Valuable Expert 2012
Top Expert 2014
Commented:
Hi, according to here:
http://dotnetzip.codeplex.com/discussions/62831


after you register the DLL using
regsvr32 <pathtodll>\Ionic.Zip.dll

you might need to do this:

"
What I would suggest is to re-register the assembly then.

open a cmd.exe prompt
cd to the directory that holds the Ionic.Zip.dll file
c:\windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe  /codebase  Ionic.Zip.dll
try running your script again
"

Regards,

Rob.