如何在命令行下调用WindowsXP自带的ZIP功能压缩文件?

CobraKing 2007-11-08 08:52:09
如题,Windows XP自带了ZIP功能,可以通过鼠标右键进行压缩操作。我是想做个批处理文件,调用这个ZIP功能,成批的压缩多个指定的文件和文件夹。请问如何实现?
注:就是要使用Windows XP自带的ZIP,而不是其他第三方软件,如WinRAR;因为客户的机器很多,统一装软件工作量非常大。
...全文
8935 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
drifter250771 2007-12-03
  • 打赏
  • 举报
回复
zipfldr.dll是以dll注册方式挂载在explorer上的,只能在GUI里交互式使用,好像没有在命令行下调用的方式
CobraKing 2007-12-03
  • 打赏
  • 举报
回复
不知道是不是OS的关系,我也不能在命令行下用ZIP命令。
drifter250771 2007-12-03
  • 打赏
  • 举报
回复
首先检查C:\Program Files目录下有没有Winzip

你这个winzip是第三方软件了哦,难怪你可以运行到zip.exe。顶楼是说WinXP内置的unzip功能
ljc007 2007-12-03
  • 打赏
  • 举报
回复
//不知道是不是OS的关系,我也不能在命令行下用ZIP命令。

首先检查C:\Program Files目录下有没有Winzip
如果有的话,再把C:\Program Files加到path系统变量里面就行了

[code=BatchFile]@echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /d "%path%;C:\Program Files" /f[/code]
ljc007 2007-11-14
  • 打赏
  • 举报
回复
//1楼的,那个好象不是windowsXP的zip命令吧?

我用的是正版XP,盗版的不清楚^_^
jhonlonehou 2007-11-14
  • 打赏
  • 举报
回复
1楼的,那个好象不是windowsXP的zip命令吧?
zjcxc 2007-11-09
  • 打赏
  • 举报
回复
另外, 系统自带的 iexpress 也可以做压缩, 这个是有向导式有用户界面的
zjcxc 2007-11-09
  • 打赏
  • 举报
回复

makecab 都是系统自带的压缩命令

Cabinet Maker - Lossless Data Compression Tool

MAKECAB [/V[n]] [/D var=value ...] [/L dir] source [destination]
MAKECAB [/V[n]] [/D var=value ...] /F directive_file [...]

source File to compress.
destination File name to give compressed file. If omitted, the
last character of the source file name is replaced
with an underscore (_) and used as the destination.
/F directives A file with MakeCAB directives (may be repeated). Refer to
Microsoft Cabinet SDK for information on directive_file.
/D var=value Defines variable with specified value.
/L dir Location to place destination (default is current directory).
/V[n] Verbosity level (1..3).
ljc007 2007-11-08
  • 打赏
  • 举报
回复
建议先看看帮助

C:\>zip -help
Copyright (C) 1990-1996 Mark Adler, Richard B. Wales, Jean-loup Gailly
Onno van der Linden and Kai Uwe Rommel. Type 'zip -L' for the software License.
Zip 2.1 (April 27th 1996). Usage:
zip [-options] [-b path] [-t mmddyy] [-n suffixes] [zipfile list] [-xi list]
The default action is to add or replace zipfile entries from list, which
can include the special name - to compress standard input.
If zipfile and list are omitted, zip compresses stdin to stdout.
-f freshen: only changed files -u update: only changed or new files
-d delete entries in zipfile -m move into zipfile (delete files)
-k force MSDOS (8+3) file names -g allow growing existing zipfile
-r recurse into directories -j junk (don't record) directory names
-0 store only -l convert LF to CR LF (-ll CR LF to LF)
-1 compress faster -9 compress better
-q quiet operation -v verbose operation/print version info
-c add one-line comments -z add zipfile comment
-b use "path" for temp file -t only do files after "mmddyy"
-@ read names from stdin -o make zipfile as old as latest entry
-x exclude the following names -i include only the following names
-F fix zipfile (-FF try harder) -D do not add directory entries
-A adjust self-extracting exe -J junk zip file prefix (unzipsfx)
-T test zipfile integrity -X eXclude eXtra file attributes
-$ include volume label -S include system and hidden files
-h show this help -n don't compress these suffixes

6,871

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧