As far as I can tell, 7-zip doesn't have a command that does what you're looking for. Here's a Windows batch file script which I think will do what you want. It should be run from the command line so you can supply a path to the root of the folder tree to be processed.
File unzipper.bat
@echo off
setlocal
if "%1"=="" goto Usage
call :Get7zCmd
:: Recurse folder passed in as paramater
for /r %1 %%Z in (*.zip) do (
echo ====
rem Change to the directory of zip file
cd /d "%%~dpZ"
rem Extract all files to current directory
echo %_7zCmd% e "%%~nxZ" -y
rem Delete the zip file
echo del "%%~nxZ"
)
goto End
:Usage
echo.
echo Parses through folder structure starting at the specified path, finding
echo and extracting the contents of all zip files found, and then deletes
echo the zip file.
echo.
echo Usage:
echo %~n0 root-directory-path
echo.
echo For example:
echo.
echo %~n0 "D:\some folder"
:End
goto :EOF
:: ==========================
:: Subroutine Get7zCmd
:: Determines the full path to 7-zip command-line executable from the Windows
:: Registry and sets the variable "_7zCmd" to the result.
:Get7zCmd
set Reg.Key=HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\7zFM.exe
set Reg.Val=Path
for /F "Tokens=2*" %%A in ('Reg Query "%Reg.Key%" /v "%Reg.Val%" ^| find /I "%Reg.Val%"') do call set PathDirectory=%%B
set _7zCmd="%PathDirectory%%\7z.exe"
exit /b 0
Since as a whole what the script does is fairly radical and potentially destructive because it might extract large numbers of file and delete many zip files afterward, I've disabled the commands on lines 12 and 14 which would do those things by prefixing them with echo
. This make them just print out what they would have done if the echo
wasn't there. That way you can test the script first without doing any damage to your file system should there be some sort of unexpected problem.
To modify the script actually perform these actions, you'll need to remove the echo
on each of the two lines. Standard disclaimer of any liability applies, of course.