Vba shell32解压缩而不保留zip文件中的目录结构 [英] Vba shell32 unzip without preserving directory structure from zip file

查看:141
本文介绍了Vba shell32解压缩而不保留zip文件中的目录结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从具有多级目录结构的zip文件中将所有文件或特定文件提取到单个文件夹?

我查看了使用Windows轻松压缩/解压缩文件 Shell32,但这会在使用时从zip文件重新创建目录结构.CopyHere



使用VBA .copyhere方法的原因是保持项目自包含。

目前外部应用程序用于解压缩文件,但这会导致其他问题,我想避免这些问题。



任何帮助或建议非常感谢。



我尝试了什么:



http ://www.codeproject.com/Tips/257193/Easily-Zip-Unzip-Files-using-Windows-Shell

解决方案

我建​​议下载 [ ^ ] 7-zip [ ^ ] - 非常好的归档器,支持多种格式。此存档包含 7za.exe ,可与命令参数一起使用。这意味着,您将能够列出存档文件的内容并准确提取您想要的内容。



如何使用它?使用VBA Shell功能 [ ^ ]或API ShellExecute功能 [ ^


对于命令行参数,请点击此链接:

http://www.dotnetperls.com/7-zip-examples [ ^ ]

命令行版本用户指南 [ ^ ]

How to extract all files or a specific file, to a single folder, from a zip file that has a multi level directory structure ?
I have looked into "Easily Zip / Unzip Files using Windows Shell32", but this recreates the directory structure from the zip file when using .CopyHere

The reason for using the VBA .copyhere method is to keep the project self contained.
Currently an external application is used to unzip files, but this causes other issues, which I want to avoid.

Any help or suggestions would be greatly appreciated.

What I have tried:

http://www.codeproject.com/Tips/257193/Easily-Zip-Unzip-Files-using-Windows-Shell

解决方案

I'd suggest to download[^] 7-zip[^] - very good archiver, which supports many formats. This archive contains 7za.exe, which can be used with command arguments. This mean, you'll be able to list the content of archive file and extract exactly that what you want.

How to use it? Use VBA Shell function[^] or API ShellExecute function[^] with arguments.

For command line arguments, follow this link:
http://www.dotnetperls.com/7-zip-examples[^]
Command Line Version User's Guide[^]


这篇关于Vba shell32解压缩而不保留zip文件中的目录结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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