Skip to main content

Create Archive

Command description

Create an archive from the specified file or folder, save it to the target path, and return the generated archive path. Extract it with another archive utility or the Extract Archive command.

Command Input Parameters

input parametersInput parameter typeDescription
Path to ArchivestrFull path, for example C:\xx
Save PathstrSave the compressed file to this folder
Archive PasswordstrOptional

Command Output Parameters

Output parametersOutput parameter typeDescription
Archive File PathstrThe full path of the compressed file

Edge Cases

  • The command reports an error if Path to Archive does not exist. It can point to a file or folder.
  • When Save Path is empty, the archive is created beside the source path and uses the source name with a .zip extension.
  • If Save Path has no extension, .zip is appended automatically. An existing archive is not overwritten; the new archive receives a suffix such as _1 or _2.
  • A missing parent directory is created automatically. The command reports an error if compression fails, the password is invalid, or 7-Zip cannot run.