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

前端之家收集整理的这篇文章主要介绍了windows – 如何提取此文件夹子目录中的所有存档?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何在文件夹中的子目录中提取多个存档,并将结果输出回存档所在的文件夹中.
首先,安装 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.

希望这对某人有用.

猜你在找的Windows相关文章