DnZip is a .NET command-line tool for creating ZIP archives from one or more files and directories, with optional recursive directory inclusion and password-based encryption.
It is intended as a simple alternative to the default Windows ZIP workflow, especially when you need encrypted archives from the command line.
Package: DnZip on NuGet
DnZip is distributed as a .NET global/local tool package.
- Create a ZIP archive from one or more files and directories
- Include subdirectories recursively
- Encrypt the archive with a password prompt
- Omit directory entries like
zip -D - Use Shift_JIS entry encoding for better compatibility with common Windows archive tools
You can install DnZip as a .NET tool:
dotnet tool install --global DnZipYou can also install it locally for a specific repository:
dotnet new tool-manifest
dotnet tool install DnZipIf you want to update an existing installation:
dotnet tool update --global DnZipdnzip [options] <archiveFilePath> <sourcePath> [sourcePath...]| Argument | Description |
|---|---|
archiveFilePath |
Output path of the ZIP archive to create |
sourcePath |
One or more files or directories to archive |
| Option | Description |
|---|---|
-r, --recurse |
Include subdirectories recursively |
-e, --encrypt |
Prompt for a password and create an encrypted ZIP archive |
-D, --no-dir-entries |
Do not create directory entries |
Create a ZIP file from a directory:
dnzip output.zip ./dataCreate a ZIP file including subdirectories:
dnzip output.zip ./data --recurseCreate an encrypted ZIP file:
dnzip output.zip ./data --encryptCreate an encrypted ZIP file including subdirectories:
dnzip output.zip ./data --recurse --encryptCreate a ZIP file from multiple inputs:
dnzip output.zip ./docs ./src/appsettings.json ./assets --recurseCreate a ZIP file without directory entries, like zip -D:
dnzip output.zip ./data --recurse --no-dir-entries- Returns exit code
0on success - Returns exit code
1on failure - Prints an error message if any source path does not exist
- Prompts twice for password confirmation when
--encryptis used