加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

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

发布时间:2021-05-23 15:41:02 所属栏目: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 Files7-zip7z.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.

希望这对某人有用.

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读