creating a zipfile and adding a file to it from a [vb] script on windows 2000. How?

Hi peeps.

Another programmy one for you.

I am trying to write a script which will run as a scheduled task on a windows 2000 server which has an unlicenced copy of winzip on it.

I know how to use built in zipping in a script on XP but this isn’t XP.

I have script to use winzip but this copy of winzip isn’t registered so I can’t use it from script.

I’d prefer to avoid putting anything on there (such as a freeware zipper) as I don’t really have permission to.
So do I Have any options left?

I’m fairly certain there is no way to edit zip files with vbscript alone.

My initial inclination would be to use 7-Zip as it’s free, open source, and supports command line switches. However, your injunction against third-party software doesn’t leave many choices.

Does it have to be a zip file? Windows 2000 includes the program Makecab.exe which can create .cab archives from the command line. These should be adequate for most of the functions that zip files serve, though the compression is not as good.

Hi Lobsang,

If I were doing this I’d look for a COM interface for the Zip API. I’ve had a quick scan and there doesn’t appear to be one. My second option would be doing a

CreateObject Shell
and a oShell.Execute “c:\windows\zip.exe -params files.src file.zip”

But that requires a zip exe. I’ve not got a w2k box here so I don’t know how that would go. Do you have the command line winzip installed? If it doesn’t prompt for confirmation that it’s no longer free, you should be able to do option 2 with it.

It would be way easier if you could put an exe on the box, or at least have one which is drive mappable to from the host. Then just use a UNC path in the oShell.Execute.

tim