ZipFolder

- Posted in Coding by

using ZipFolder from the Windows command-line

ZipFolder is a nifty little Windows command-line utility that is passed two arguments: (1) the folder that is to be compressed into a .zip archive, and (2) the name of the resulting archive (with .zip extension)

Note: this utility requires that you have installed the .NET Framework 3.5 but Windows should prompt you to install it, if it is missing.

The usefulness of this CLI utility lies in the fact that we can leverage it from programming code. Aside from that scenario, most Windows users won't find much reason to use it.

↓ZipFolder

Compressing to and decompressing from zip archive

- Posted in Coding by

This is non-trivial, but at some point in the past I looked into compressing and decompressing programmatically using C#:

I've hosted the source code on GitHub demonstrating using .NET to compress a folder and its contents into a single .zip archive. It also demonstrates decompressing such an archive into its component directory, subdirectories, and files.

And here are a couple libraries you'll need to use: /r:System.IO.Compression.dll /r:System.IO.Compression.FileSystem.dll

Zip from the Windows command line

- Posted in Coding by

If a valid subdirectory is passed in as an argument on the command-line, will zip it to .zip file that is located in same directory as executing code:

download sourcecode

Zip a passed directory using c-sharp

- Posted in Coding by

If passed a valid subdirectory, this 60-line C# console program will zip it to .zip file that is located in same directory as executing code.

Compress to archive using c-sharp

- Posted in Coding by

I've hosted the source code on GitHub demonstrating using .NET to compress a folder and its contents into a single .zip archive. It also demonstrates decompressing such an archive into its component directory, subdirectories, and files.

To compile, you'll need response file resp.rsp in the same directory as simpleCompExt.cs. The contents of that response file should be:

/r:System.IO.Compression.dll
/r:System.IO.Compression.FileSystem.dll
/out:simple.exe
simpleCompExt.cs

To compile from the command line, execute the following from the source code directory:

csc @resp.rsp

If you want to experiment with this, be sure to add a few small files to the /start subdirectory (so that there's something to compress and extract).