7z.exe 命令参数

语法格式:(详细情况见7-zip帮助文件,看得头晕可以跳过,用到再学) 
7z <command> [<switch>...] <base_archive_name> [<arguments>...] 
7z.exe的每个命令都有不同的参数<switch>,请看帮助文件 
<base_archive_name>为压缩包名称 
<arguments>为文件名称,支持通配符或文件列表 
a: 添加文件的压缩包,或者创建新的压缩包。 
d: 从压缩包中删除文件。 
e: 从压缩包中提取。 
t: 测试压缩包的是否出错。 
u: 更新压缩包中的文件。 
其中,7z是至命令行压缩解压程序7z.exe,<command>是7z.exe包含的命令,列举如下: 
a: Adds files to archive. 添加至压缩包 
a命令可用参数: 
-i (Include) 
-m (Method) 
-p (Set Password) 
-r (Recurse) 
-sfx (create SFX) 
-si (use StdIn) 
-so (use StdOut) 
-ssw (Compress shared files) 
-t (Type of archive) 
-u (Update) 
-v (Volumes) 
-w (Working Dir) 
-x (Exclude) 
b: Benchmark 
d: Deletes files from archive. 从压缩包中删除文件 
d命令可用参数: 
-i (Include) 
-m (Method) 
-p (Set Password) 
-r (Recurse) 
-u (Update) 
-w (Working Dir) 
-x (Exclude) 
e: Extract解压文件至当前目录或指定目录 
e命令可用参数: 
-ai (Include archives) 
-an (Disable parsing of archive_name) 
-ao (Overwrite mode) 
-ax (Exclude archives) 
-i (Include) 
-o (Set Output Directory) 
-p (Set Password) 
-r (Recurse) 
-so (use StdOut) 
-x (Exclude) 
-y (Assume Yes on all queries) 

l: Lists contents of archive. 
t: Test 
u: Update 

x: eXtract with full paths用文件的完整路径解压至当前目录或指定目录 
x命令可用参数: 
-ai (Include archives) 
-an (Disable parsing of archive_name) 
-ao (Overwrite mode) 
-ax (Exclude archives) 
-i (Include) 
-o (Set Output Directory) 
-p (Set Password) 
-r (Recurse) 
-so (use StdOut) 
-x (Exclude) 
-y (Assume Yes on all queries) 
-m (Set compression Method) switch 
Specifies the compression method.
 

【备注】

1、x命令与e命令的区别,x命令表示解压缩,并且使得压缩包内的文件所在的目录结构保持不变。如果你希望解压缩后所有的文件都存放在同一个目录下,则使用e这个命令。

2、解压命令样例:

7z.exe x "D:\TC19950FX.zip" -p"123456" -o"d:\output" -aoa

-p 密码

-o 输出文件夹

-aoa 文件覆盖模式为覆盖所有文件

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值