Commands & Syntax > Commands > File Mainpulation >

ZIP - < zip_createfile >() ... [Pro]

www.perfectkeyboard.com

 

File ZIP
<zip_createfile>("Zip file","Files to archive",Subfolders,"Password")
Available in: Professional edition

This command archives one or multiple files to a single ZIP file.

 

#

Parameter name

Parameter description

1

Zip file

(Full) path to the ZIP file to be created. Example: c:\temp\zipfile.zip.

2

Files to archive

(Full) file path or wildcard mask of files that will be included (zipped) to the ZIP file. Example: c:\temp\*.txt.

3

Subfolders

If 1, also files from subfolders that match the "Input files mask" are included.
If 0, the files from subfolders are not included.

4

Password

If a password is provided then the zip file created is password protected.

 

Example (Macro Steps):

 

1

<#> <#> This example shows how to zip multiple files to a single ZIP file.

2

<#> <#>

3

Macro execution: ONLY COMMANDS

4

<#> <#> Create folder for sample files

5

Folder CREATE "c:\temp\zip_sample"

6

<#> <#> Create sample files

7

File CREATE "c:\temp\zip_sample\file1.txt"

8

File CREATE "c:\temp\zip_sample\file2.txt"

9

File CREATE "c:\temp\zip_sample\file3.txt"

10

<#> <#> Zip files to a zip file

11

File ZIP "c:\temp\zip_sample\*.txt" to "c:\temp\zip_sample\zipfile.zip", Subfolders = No, Password =

12

<#> <#> Open folder to see the results

13

Folder OPEN open folder "c:\temp\zip_sample" in Windows Explorer.

Example (Plain Text):

 

<#> This example shows how to zip multiple files to a single ZIP file.

<#>

<cmds>

 

<#> Create folder for sample files

<dircreate>("c:\temp\zip_sample",0)

 

<#> Create sample files

<filecreate>("c:\temp\zip_sample\file1.txt",0)

<filecreate>("c:\temp\zip_sample\file2.txt",0)

<filecreate>("c:\temp\zip_sample\file3.txt",0)

 

<#> Zip files to a zip file

<zip_createfile>("c:\temp\zip_sample\zipfile.zip","c:\temp\zip_sample\*.txt",0, "")

 

<#> Open folder to see the results

<diropen>("c:\temp\zip_sample",0)