# Does XP have a command line compression utility?

**URL:** <https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215>\
**Category:** Factual Questions\
**Created:** [January 16, 2007, 6:02pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215 "2007-01-16T18:02:42Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [January 16, 2007, 6:02pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/1 "2007-01-16T18:02:42Z")

</div>

Does XP have a command line compression (zipping) utility?

I’ve used WinZip Pro in the past, but I don’t have a registered copy. I’m surprised that XP offers a nice little compression utility, but doesn’t seem to have a command line option to use it.

Are there any other free command line zipping utilities that you would give a nod to?

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [January 16, 2007, 6:24pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/2 "2007-01-16T18:24:01Z")

</div>

At the command prompt, you would use the COMPACT command. Type HELP COMPACT for syntax and switches.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [January 16, 2007, 6:25pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/3 "2007-01-16T18:25:57Z")

</div>

[QUOTE=Q.E.D.]  
At the command prompt, you would use the COMPACT command. Type HELP COMPACT for syntax and switches.  
[/QUOTE]

From a quick glance at the help, it looks like you’d use this to alter the local drive’s compression settings for a given directory rather than to make .zip files. Or am I misreading it?

---

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [January 16, 2007, 6:45pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/4 "2007-01-16T18:45:47Z")

</div>

[QUOTE=ultrafilter]  
From a quick glance at the help, it looks like you’d use this to alter the local drive’s compression settings for a given directory rather than to make .zip files. Or am I misreading it?  
[/QUOTE]

I thought that Compress was the utility for compressing files and directories in an NTFS file system. What I’m looking for is a command line zipping and unzipping utility, which (I thought) was something else. Currently I can right click on a file \>\> Send To \>\> Compressed (Zipped) Folder. I want to be able to do that with a command line interface.

I’m off to run a test of compress on a zipped folder. I’ll let you know how it goes.

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [January 16, 2007, 6:54pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/5 "2007-01-16T18:54:46Z")

</div>

If that doesn’t do what you want it to, you can also still get the PKZIP and PKUNZIP command line utilities that originally spawned WinZip from [here](http://www.pc-shareware.com/pkzip.htm), if you want to compress them into proper ZIP format.

---

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [January 16, 2007, 6:59pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/6 "2007-01-16T18:59:31Z")

</div>

[QUOTE=Enright3]  
I thought that Compress was the utility for compressing files and directories in an NTFS file system. What I’m looking for is a command line zipping and unzipping utility, which (I thought) was something else. Currently I can right click on a file \>\> Send To \>\> Compressed (Zipped) Folder. I want to be able to do that with a command line interface.

I’m off to run a test of compress on a zipped folder. I’ll let you know how it goes.  
[/QUOTE]

OK, first of all change the word compress with Compact where necessary.

second, I may be using it incorrectly, but I don’t think Compact is for zipping and unzipping files.

---

<div class="post-metadata">

**Author:** ![Enright3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/enright3/32/2897_2.png) [@Enright3](https://boards.straightdope.com/u/Enright3)\
**Post date:** [January 16, 2007, 7:00pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/7 "2007-01-16T19:00:47Z")

</div>

[QUOTE=Q.E.D.]  
If that doesn’t do what you want it to, you can also still get the PKZIP and PKUNZIP command line utilities that originally spawned WinZip from [here](http://www.pc-shareware.com/pkzip.htm), if you want to compress them into proper ZIP format.  
[/QUOTE]

Sweeeeet! I think this is going to have to do.

Thanks, Q.E.D.

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [January 16, 2007, 7:03pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/8 "2007-01-16T19:03:31Z")

</div>

[QUOTE=Enright3]  
Sweeeeet! I think this is going to have to do.  
[/QUOTE]

Actually, it looks like that site only has PKUNZIP available. Both of them _are_ available [here](http://www.freewarehof.org/olhof.html).

---

<div class="post-metadata">

**Author:** ![chappachula](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@chappachula](https://boards.straightdope.com/u/chappachula)\
**Post date:** [January 16, 2007, 7:10pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/9 "2007-01-16T19:10:09Z")

</div>

be aware of a limitation with PKZip and PKunzip : they only work with short file names of 8 characters or less. (Like the original DOS computers pre-1995.)

PKZip will not properly work with a file whose name is longer than 8 letters .  
pkUNnzip will successfully open an archive that was zipped with, say Winzip, and whose file names were long–but the opened file will be truncated to an 8-letter name.

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [January 16, 2007, 7:24pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/10 "2007-01-16T19:24:46Z")

</div>

[QUOTE=chappachula]  
be aware of a limitation with PKZip and PKunzip : they only work with short file names of 8 characters or less.  
[/QUOTE]

Excellent point. In that case, there’s also [PicoZipCL](http://www.picozip.com/command-line.html), a freeware utility with a similar interface which, as far as I can tell, _does_ support long filenames. Note that in order to use it:

> [@](#):
>
> IMPORTANT: PicoZip 4.0 (or newer) must be installed (does not have to be registered) in order to use PicoZip Command Line Tool. In addition, PicoZip Command Line Tool must be installed in the same folder as PicoZip.

---

<div class="post-metadata">

**Author:** ![Omphaloskeptic](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@Omphaloskeptic](https://boards.straightdope.com/u/Omphaloskeptic)\
**Post date:** [January 16, 2007, 7:58pm UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/11 "2007-01-16T19:58:22Z")

</div>

[QUOTE=Enright3]  
Are there any other free command line zipping utilities that you would give a nod to?  
[/QUOTE]  
If you like the command line, I highly recommend [Cygwin](http://cygwin.com/). This provides a Unix-like command-line interface running under Windows, with lots of the standard Unix utilities, scripting languages, etc. For file archiving and compression you can choose among tar, zip, compress, gzip, and bzip2 at least.

---

<div class="post-metadata">

**Author:** ![yoyodyne](https://avatars.discourse-cdn.com/v4/letter/y/a9a28c/32.png) [@yoyodyne](https://boards.straightdope.com/u/yoyodyne)\
**Post date:** [January 17, 2007, 1:07am UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/12 "2007-01-17T01:07:34Z")

</div>

[QUOTE=Enright3]  
Are there any other free command line zipping utilities that you would give a nod to?  
[/QUOTE]  
[7-Zip](http://www.7-zip.org/)

---

<div class="post-metadata">

**Author:** ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)\
**Post date:** [January 17, 2007, 5:34am UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/13 "2007-01-17T05:34:49Z")

</div>

A second vote for 7-Zip. It does everything WinZip does and more. It has a powerful command-line interface, it handles a good range of file formats, and it’s totally free – no nag screens.

---

<div class="post-metadata">

**Author:** ![FRDE](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@FRDE](https://boards.straightdope.com/u/FRDE)\
**Post date:** [January 17, 2007, 9:29am UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/14 "2007-01-17T09:29:34Z")

</div>

[QUOTE=chappachula]  
be aware of a limitation with PKZip and PKunzip : they only work with short file names of 8 characters or less. (Like the original DOS computers pre-1995.)

PKZip will not properly work with a file whose name is longer than 8 letters .  
pkUNnzip will successfully open an archive that was zipped with, say Winzip, and whose file names were long–but the opened file will be truncated to an 8-letter name.  
[/QUOTE]

PKZIP v2.5 03-01-1999 certainly understands and stores long file names

---

<div class="post-metadata">

**Author:** ![FRDE](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@FRDE](https://boards.straightdope.com/u/FRDE)\
**Post date:** [January 17, 2007, 9:32am UTC](https://boards.straightdope.com/t/does-xp-have-a-command-line-compression-utility/388215/15 "2007-01-17T09:32:18Z")

</div>

PKUNZIP ® FAST! Extract Utility Version 2.50 03-01-1999  
Copr. 1989-1999 PKWARE Inc. All Rights Reserved. Shareware Version  
PKUNZIP Reg. U.S. Pat. and Tm. Off.

\_ Pentium class CPU detected.  
\_ XMS version 3.00 detected.  
\_ DPMI version 0.90 detected.

Searching ZIP: tt.ZIP

Length Method Size Ratio Date Time CRC-32 Attr Name

* * *

```
  4 Stored 4 0% 17-01-2007 09:28 8bc21544 --wa testtesttest.test

```

* * *

```
  4 4 0% 1
```
