如何使用Winzip命令行从文件夹ZIP特定文件? [英] How to ZIP specific files from a folder using Winzip command line?

查看:674
本文介绍了如何使用Winzip命令行从文件夹ZIP特定文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用此命令,我可以从文件夹ZIP所有文件:

With this command, I'm able to ZIP all files from the folders:

wzzip.exe -a -p -r C:\DestinationPath\DataFiles_20130903.zip C:\SourcePath\*.*



But, my folder has .dat,.bat,.txt,.xls files.I want to ZIP only .dat and .bat file.How to do this?

感谢。

推荐答案

使用此命令(针对问题中的特定方案):

use this command (for the particular scenario in the question):

wzzip.exe -a -p -r C:\DestinationPath\DataFiles_20130903.zip C:\SourcePath\*.dat C:\SourcePath\*.bat

请参阅以下链接:

winZip命令行参考1

winZip命令行参考2 < a>

winZip command line Reference 2

要提供多个文件名,您还可以使用 @filename ,其中文件名要在zip文件中包含的文件列表。

To provide multiple file names you can also use @filename where the filename is a file which contains the list of files which you want to include in the zip file.

如果您使命令可配置,那么您可以询问正在调用命令的用户/其他程序选择文件扩展名,然后使用java代码或您喜欢的任何其他语言将这些所选扩展名写入文件名文件。

If you are making the command configurable then you can ask the user/ other program which is calling your command to select the file extensions and then write these selected extensions into the "filename" file using java code or any other language you prefer.

示例如果用户选择 bat dat ,然后输入C:\SourcePath\ * .bat :\SourcePath\ * .dat(假设文件名为 fileExtensions.txt )并调用命令

For example if the user selects bat and dat , then write "C:\SourcePath\*.bat" and "C:\SourcePath\*.dat" into the file(assume filename is fileExtensions.txt) and call the command

wzzip.exe -a -p -r "C:\DestinationPath\DataFiles_20130903.zip" @"C:\SourcePath\fileExtensions.txt"

这篇关于如何使用Winzip命令行从文件夹ZIP特定文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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