I am not sure about the OP's intent but I think it is a good idea to have a subfolder for each .zip file, so that files with the same name will not get overwritten. (Just like when you drag and drop with the right mouse button multiple .zip files and select 7-Zip > Extract Files ... from the local menu.)
For this I use this at the command line:
for /f "usebackq delims=" %f in ( `dir /b /s *.zip` ) do 7z x "%f" -o"%~pf%~nf"
If you do not have 7-Zip's program folder in your PATH
environment variable, you need to write its full path. On x86 Windows or x64 Windows with x64 7-Zip:
for /f "usebackq delims=" %f in ( `dir /b /s *.zip` ) do "C:\Program Files\7-Zip\7z.exe" x "%f" -o"%~pf%~nf"
On x64 Windows with x86 7-Zip:
for /f "usebackq delims=" %f in ( `dir /b /s *.zip` ) do "C:\Program Files (x86)\7-Zip\7z.exe" x "%f" -o"%~pf%~nf"
Note: cmd substitutes %~pf
with the path (actually directory name, including a backslash at the end) of the variable %f
, and %~nf
with the filename (without file extension).