站长网 Windows windows – 如何提取此文件夹子目录中的所有存档?

windows – 如何提取此文件夹子目录中的所有存档?

如何在文件夹中的子目录中提取多个存档,并将结果输出回存档所在的文件夹中. 首先,安装 7-zip. 在包含许多子目录的目录的根目录中创建一个bat文件,其中包含存档.然后粘贴以下内容: FOR /D /r %%F in (“*”) DO ( pushd %CD% cd %%F FOR %%X in (*.rar *.zip

如何在文件夹中的子目录中提取多个存档,并将结果输出回存档所在的文件夹中.

首先,安装
7-zip.

在包含许多子目录的目录的根目录中创建一个bat文件,其中包含存档.然后粘贴以下内容:

FOR /D /r %%F in ("*") DO (
    pushd %CD%
    cd %%F
        FOR %%X in (*.rar *.zip) DO (
            "C:\Program Files\7-zip\7z.exe" x "%%X"
        )
    popd
)

启动蝙蝠,所有rar / zip将被提取到它们所包含的文件夹中.

这是如何运作的?

FOR /D /r %%F in (“*”) DO (

For loop to loop through all folders in the current directory,and put the path into a variable %%F.

pushd %CD%

Put the current directory that we are in into memory.

cd %%F

Set the folder from variable %%F as the current directory.

06001

For all the rar and zip files in the current folder,do:

06002

Run 7-zip on the files. Quotes are needed around %%X because some file names have spaces in them.

06003

Return to the previous directory that we previously stored in the memory.

希望这对某人有用.

本文来自网络,不代表站长网立场,转载请注明出处:https://www.zwzz.com.cn/html/server/windows/2021/0523/4196.html

作者: dawei

【声明】:站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。
联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部