Windows

Windows 是否有用於命令行的內置 ZIP 命令?

  • November 21, 2020

由於 Windows 資源管理器(至少從 Windows XP 開始)對 ZIP 文件有一些基本支持,因此似乎應該有一個等效的命令行,但我似乎找不到任何跡象。

Windows(XP、Vista、7、8、2003、2008、2013)是否附帶內置命令行 zip 工具,還是我需要堅持使用第三方工具?

它不是內置在 Windows 中,而是在資源工具包工具中,如COMPRESS,

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.

例子:

COMPRESS temp.txt compressed.txt
COMPRESS -R *.*
COMPRESS -R *.exe *.dll compressed_dir

引用自:https://serverfault.com/questions/39071