How can I be sure that a very large zip file is finished compressing?
17:00 08 Jul 2017

I am writing a VBScript to try to compress multiple directories in different locations into the same Zip file.

The current solution I am using is to iterate over the directories I want to compress (of which there are currently 2), get the file objects and use the copyHere method to copy the source folder into a zip file with the proper header format.

That part seems to be working okay, the difficulty I am having is with the error checking. The only two solutions I have found online are to get the count of objects in the source and target directories and sleep until they are the same, or to check if the zip file is open for appending and sleep until it is.

The first option is easy with one directory but becomes much more tedious with multiple folders, not to mention that Windows will likely create an object in the target directory before it has finished copying and I am compressing files potentially over 10 GB so that solution won't work.

I had tried to implement the second solution but every time the loop got to the second call to CopyHere it would tell me that the zip file was corrupted from the first iteration. Is it not possible to compress very large files to a zip with VBScript?

Any other suggestions as to how I can error check that the compressing is done using VBScript would be very helpful.

windows vbscript zip compression large-files