Home » Questions » Computers [ Ask a new question ]

Is there a way to use the built-in Windows file compression tool on the command line?

Is there a way to use the built-in Windows file compression tool on the command line?

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

Asked by: Guest | Views: 353
Total answers/comments: 2
Guest [Entry]

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.
Guest [Entry]

"I just saw this on ServerFault.com:

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"