7zip extract * .zip在子文件夹中

时间:2014-12-18 07:49:50

标签: batch-file 7zip subdirectory

我在很多子文件夹中都有很多* .zip文件。我尝试使用此命令通过批处理文件提取所有这些,但它不起作用。我该如何解决?

FOR /F "tokens=* delims=" %%A in ('dir /b /s *.zip') do (7z.exe l -r "%%A" >> listing.txt)

我关注this tutorial

2 个答案:

答案 0 :(得分:0)

尝试此命令,它应该听起来像你正在寻找的那样:

FOR /F "usebackq tokens=* delims=" %%A IN (`dir /b /s *.zip`) DO (
    REM Extract each zip file to a folder with same name as the file.
    7z x "%%A" -o"%%~dpA"
)

答案 1 :(得分:-1)

    FOR /F "usebackq tokens=* delims=" %%A IN (`dir /b *.zip`) DO (
    REM Extract each zip file to a folder with same name as the file.
    7z e "%%A" -o"%%~dnA"
)

这对我有用