您的位置:首页技术文章
文章详情页

Windows Vista自带的压缩工具你发现没?

浏览:4日期:2023-08-05 13:24:37
Windows Vista系统自带了很多丰富使用的命令行工具,今天我们就来介绍一下makecab工具,从它的名字就可以看出是制作cab压缩文件的工具,cab压缩格式由微软公司设计,Windows Vista、XP系统的安装程序就是采用的cab压缩格式,压缩比例不比RAR、ZIP格式低。 我们在Vista开始菜单中输入cmd回车,输入makecab e:windowsnotepad.exe d:notepad.cab 。意思就是压缩e盘上windows vista自带的记事本程序,保存到磁盘分区d根目录中,如图1所示: 图1 我们可以看到Windows Vista记事本原始文件大小为 148 KB,如图2所示: 图2 在磁盘分区D上,我们可以看到压缩后的notepad.cab 文件大小为 112 KB,如图3所示: 图3 从结果看到我们只减少 148-112=36 KB,这是因为我们使用的是makecab默认的压缩算法。我们输入makecab /?查看它的参数如下 C:UsersVista地带>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). 这里我们可以使用compressiontype=lzx参数,采用LZX算法或 compressiontype=mszip 采用ZIP算法。 最后我们来说一下cab格式文件的解压缩,使用extract命令可以解压缩cab格式文件,这里我们输入extract d:notepad.cab d:notepad.exe 即可还原到exe原始文件,如图4所示: 图4
标签: Windows系统