“One of the terms of the license is that the compression and decompression code for Zip folders should be tied to UI actions and not be programmatically drivable. The main product for the company that provided the compression and decompression code is the compression and decompression code itself. If Windows allowed programs to compress and decompression files by driving the shell namespace directly, then that company would have given away their entire business!”
Raymond goes on to warn of the problems you’ll see trying to program Zip Folder functions. Including the Zip function throwing up prompts when you want the actual zipping to be invisible to the user.
The alternative to using the Compressed Folders feature was expensive, so people naturally looked for “free” solutions.
The earliest example I found was some C# code, posted in December 2006
Followed then by
- Visual Basic – March 2009 manipulating zipfldr.dll to create a Compressed folder
- PowerShell – August 2010 New-ZIP
The better way to do it now, is to use System.IO.Compression