Extract zip contents into directory with same name as zip file, retain directory structure

Reading the help of the 7z-command by just typing "C:\Path To\7-Zip\7z.exe" gets the help with all possible arguments. Here we find the following interesting ones:

 e : Extract files from archive (without using directory names)

and

x : eXtract files with full paths

Trial and error shows that the latter is the one fitting your desired behaviour without bigger effort :)

After the comment by @BadmintonCat here is the addition that will create a folder to zip everything into (use as batch script with the file as argument):

@echo off

SET "filename=%~1"
SET dirName=%filename:~0,-4%

7z x -o"%dirName%" "%filename%"

From the help: -o{Directory} : set Output directory. 7z will create the directory if it does not already exist.


Just use the command: 7z x *.zip -o\*