是否可以在 Windows XP 上使用 .BAT 命令解压缩 .ZIP 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2875457/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:20:15  来源:igfitidea点击:

Is it possible to unzip .ZIP file using .BAT command on Windows XP?

windowswindows-xpzipunzipbatch-processing

提问by Rella

Is it possible to unzip .ZIP file using .BAT command on Windows XP? we have file.zip how to create a .BAT commands file to unzip\unpack it to some folder. USING ONLY NATIVE WINDOWS XP programms and commands.

是否可以在 Windows XP 上使用 .BAT 命令解压缩 .ZIP 文件?我们有 file.zip 如何创建 .BAT 命令文件以将其解压缩\解压到某个文件夹。仅使用 NATIVE WINDOWS XP 程序和命令。

So.. How to do such thing? (code example, please)

那么..如何做这样的事情?(代码示例,请)

回答by

Yes.

是的。

But it involves using "scripting" and the use of System.FileSystemObject(a good keyword). You should be able to use cscript/WSHwhich can run VBScript or JScript (WSH 5.6 comes with XP). The general idea is here. There are some other interesting "issues" with this approach though; the operations runs asynchronously and the compression dialog box may appear -- but it canbe done using standard XP tools.

但它涉及使用“脚本”和System.FileSystemObject(一个很好的关键字)。您应该能够使用可以运行 VBScript 或 JScript 的cscript/WSH(WSH 5.6 随 XP 一起提供)。总体思路在这里。不过,这种方法还有一些其他有趣的“问题”;操作异步运行,可能会出现压缩对话框——可以使用标准 XP 工具完成。

I would recommend downloading 7-zip. It is a 200~400k standalone command-line executable (depending on version), but it requires an initial "install" to grab the executable first. You don't need the GUI to run 7-zip.

我建议下载7-zip。它是一个 200~400k 的独立命令行可执行文件(取决于版本),但它需要初始“安装”才能首先获取可执行文件。您不需要 GUI 来运行 7-zip。

回答by jpabluz

No, there is no command line support for the native zip/unzip library that comes with windows XP. The only solution would be to use a uncompressing library.

不,Windows XP 附带的本机 zip/unzip 库没有命令行支持。唯一的解决方案是使用解压缩库。