Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Archive direct folder items as ZIP files

These scripts create one ZIP file for each direct file or subdirectory in a selected folder. Every archive uses the ZIP store method (compression level 0), so its data is not compressed.

ZIP files are written to the _zip_output subdirectory of the source folder. That directory is skipped automatically, so it is safe to run either script again.

Windows (PowerShell)

.\zip-items.ps1

If the execution policy blocks the script in the current session:

powershell -ExecutionPolicy Bypass -File .\zip-items.ps1

You can supply the path in advance and choose F, D, or B when prompted:

.\zip-items.ps1 -Path 'D:\data'

Optionally, skip the prompt with -Mode File, -Mode Directory, or -Mode Both.

Linux / macOS (Bash)

chmod +x zip-items.sh
./zip-items.sh

Or provide the path in advance:

./zip-items.sh '/path/to/data'

The Linux/macOS script requires the zip command. For example, install it with sudo apt install zip on Debian/Ubuntu, or brew install zip when it is missing on macOS.

Choices

  • F: create ZIP files only for direct files in the source folder.
  • D: create ZIP files only for direct subdirectories; empty directories are retained.
  • B: process both direct files and subdirectories.

About

Create one ZIP file for each direct file or subdirectory in a selected folder

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors