ZipCreateFile

This function is used to create a new empty zip file, use ZipAddFile or ZipAddBuffer to add files to the zip archive.

OutputVar := ZipCreateFile(FileName , Password)
Function Example: hZip := ZipCreateFile("MyScript.zip", "MyPassword")

Parameters

OutputVar

The name of the variable in which to store the zip handle that can be used in ZipAddFile, ZipAddBuffer and ZipCloseFile.

FileName

The name or path of the zip file to be created.

Password (optional)

The password to use for the zip file.

Remarks

Use ZipCreateFile to create a new zip file, then use ZipAddFile or ZipAddBuffer to add files to it and finally use ZipCloseFile to close the file.
You cannot add files to existing zip file or after ZipCloseFile has been called, instead UnZip all files and create a new zip file.
A_ZipCompressionLevel can be used to change compression level. Use 0 for lowest and 9 for highest compression.

Related

ZipAddFile, ZipCloseFile, ZipOptions, UnZip, ZipCreateBuffer, ZipAddBuffer, ZipCloseBuffer, UnZipBuffer, ZipRawMemory, UnZipRawMemory, ZipInfo, ZipAddFolder

Examples

hZip:=ZipCreateFile("C:\Test.zip")
ZipAddFile(hZip, "C:\MyScript.ahk")
ZipCloseFile(hZip)