windows命令promt zip / compress目录 [英] windows command promt zip/compress directory

查看:229
本文介绍了windows命令promt zip / compress目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以从cmd.exe压缩/归档一个目录及其所有子目录和文件在一个文件中?我知道有很多实用程序可用,但我需要执行操作只与Windows默认实用程序。我正在运行windows server 2003。

Is possible to compress/archive a directory with all of its sub-directories and files in a single file from cmd.exe ? I know there are a lot of utilities available but I need to perform the operation only with the windows default utilities . I'm running windows server 2003 .

推荐答案

虽然旧makecab不存储真正的目录结构,输出目录为每个文件,如果你真的需要它。该过程比使用现代实用程序更麻烦,但可以做到。

Although the old makecab doesn't store a real directory structure, you can command the output directories for each file if you really need it. The procedure is more cumbersome than using a modern utility, but can be done.

为此,您应该创建一个.ddf文件。

For doing this you should create a .ddf file.

旧的makecab手册已由MS从网络上移除。我在此处找到了副本。

The manual for the old makecab has been removed from the web by MS. I found a copy here.

在makecab手册的第33页,你会发现:

In page 33 of the makecab manual you will find:

DestinationDir = path

存储在机柜中每个文件的机柜文件中的路径前缀。

默认值:。设置DestinationDir =;默认是没有路径前缀

路径 \\)文件复制命令以生成存储在cabinet文件中的文件名。 >
EXTRACT.EXE将在提取文件时使用此文件名作为默认名称。

Examples:  
.Set DestinationDir=SYSTEM  ; Following files get SYSTEM prefix      
bin\ARIAL.TTF           ; Name in cabinet is SYSTEM\ARIAL.TTF  
.Set DestinationDir=        ; No prefix  
bin\ARIAL.TTF           ; Name in cabinet is ARIAL.TTF

HTH!

这篇关于windows命令promt zip / compress目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆