3

Instead of using Right-Click/Send To/Compress (Zipped) Folder.

I am using Windows Server 2003 Enterprise Edition.

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
the_lotus
  • 135
  • 1
  • 1
  • 6

5 Answers5

7

I would highly recommend 7zip for command-line archiving in windows. It is incredibly simple yet extremely feature rich, I have many a script that rely on it. Check out some CLI examples.

TJ L
  • 1,929
  • 2
  • 16
  • 23
  • 1
    I second that http://superuser.com/questions/5886/compressing-with-rar-vs-zip/5918#5918 – nik Aug 26 '09 at 15:36
  • Also, as `tj111` says: http://superuser.com/questions/29959/incremental-backup-and-sync-software/29964#29964 – nik Aug 26 '09 at 15:39
  • 7zip is also significantly faster than the built in compressor. – grenade Aug 26 '09 at 15:54
  • I would not highly recommend pushing this proprietary tool when compression has been available on platforms since the dawn of civilization. I wish I had a nickel for every time somebody sent me one of these wholly unnecessary file formats. – Rick O'Shea Mar 20 '17 at 17:18
4

Although I would recommend using 7-zip as tj111 recommended, to use the built in folder compression use the compact.exe command. This is installed in the \windows\system32 folder on Windows XP. See compact.exe /? for command line reference.

heavyd
  • 62,847
  • 18
  • 155
  • 177
  • **This is not the same as the "Send to Compressed (zipped) Folder" GUI option**. Please see [1](http://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line#comment131386_39080) and [2](http://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line#comment268588_39080) for more. – user66001 Sep 22 '13 at 06:11
  • 1
    This is the tool to mark files and directories so that NTFS will compress the data. It is totally unrelated to creating compressed "folders" (actually ZIP files) with the `send to` command. –  Feb 22 '17 at 03:37
3

I just saw this on ServerFault.com:

https://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line

It's not built in to windows, but it's in the resource kit

C:>compress /?

Syntax:

COMPRESS [-R] [-D] [-S] [ -Z | -ZX ] Source Destination COMPRESS -R [-D] [-S] [ -Z | -ZX ] >Source [Destination]

Description: Compresses one or more files.

Parameter List: -R Rename compressed files.

-D Update compressed files only if out of date.

-S Suppress copyright information.

-ZX LZX compression. This is default compression.

-Z MS-ZIP compression.

Source Source file specification. Wildcards may be used.

Destination Destination file | path specification. Destination may be a directory. If >Source is multiple files and -r is not specified, Destination must be a directory.

Examples: COMPRESS temp.txt compressed.txt COMPRESS -R . COMPRESS -R *.exe *.dll >compressed_dir

Hondalex
  • 1,814
  • 1
  • 11
  • 8
  • This does not create zip-compatible files. MS-ZIP is not the same thing. It compresses one file at a time, like `gzip` on Linux, instead of creating a single `.zip` file of the whole folder. – Nate Aug 26 '09 at 16:20
  • Exactly. As mentioned as comments [1](http://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line#comment131386_39080) and [2](http://serverfault.com/questions/39071/does-windows-have-a-built-in-zip-command-for-the-command-line#comment268588_39080) to the answer the above seems to be quoted from. – user66001 Sep 22 '13 at 06:13
2

using zip and unzip on the windows command line

however, this is not about the 'built-in windows file compression tool', you'll have to download 2 executables (zip and unzip, free)

0

I use Info-Zip (open source zip/unzip command line utility) and in order to increase the speed of my windows searches, gzip the resulting zip files.

Dave
  • 596
  • 1
  • 4
  • 9