Executive Summary:
| Bzip2 is a free command-line tool for compressing and decompressing data that you can also use within scripts. You can write bzip2-compressed data to a new file or append the data to an existing file. If you want to output or append bzip2 data from within Windows PowerShell, you'll have to use a batch file to spawn cmd.exe from within PowerShell. |
Although the graphical Windows shell has built-in support for compressing data into .zip files and then extracting it, Windows shell doesn't include tools that you can use from a command prompt or in a batch file. One of the handier free tools you can find for compressing data is the open-source bzip2 console application. However, if you're used to graphical tools such as WinZip, bzip2 isn't an intuitive tool. So, after telling you how to get bzip2, I'll demonstrate how to use it from scripts and at the command prompt. I'll also examine the tradeoffs in using bzip2. Although it offers good compression, it can be very CPU-intensive. . . .