Extract Archives to Subfolders in 7-Zip
Extracting compressed archives into individual folders matching their file names prevents files from cluttering your target directory. This guide explains how to extract single or multiple archive files directly into automatically named subfolders using the 7-Zip context menu and the command-line interface.
Method 1: Using the Windows Context Menu (Fastest)
The easiest way to extract one or multiple archives into their own dedicated subfolders is via the Windows File Explorer right-click menu.
- Open File Explorer and locate the archives (ZIP, RAR, 7z, TAR, etc.) you want to extract.
- Select the files. You can select a single archive or highlight multiple files at once.
- Right-click the selected file(s) to open the context menu. (On Windows 11, select Show more options if the 7-Zip submenu does not appear immediately).
- Hover your mouse over the 7-Zip menu.
- Click Extract to "*" (if multiple files are selected) or Extract to "[ArchiveName]" (if a single file is selected).
7-Zip will automatically create a folder corresponding to each archive's base name in the current directory and unpack the contents inside.
Method 2: Using 7-Zip File Manager
If you are working directly inside the 7-Zip File Manager application:
- Open 7-Zip File Manager.
- Navigate to and select the archives you want to unpack.
- Click the blue Extract button on the top toolbar.
- In the Extract to: field, append
*\to the end of the destination path (for example,C:\Extracted\*\). - Click OK.
The wildcard * tells 7-Zip to replace the symbol with
the individual archive's name for every item being processed.
Method 3: Using the Command Line
If you are automating extractions via scripts or prefer the command
prompt, use the -o switch with the wildcard syntax.
For a Single Archive
Run the following command in Command Prompt:
7z x "archive.zip" -o*The -o* switch directs 7-Zip to create an output
directory named after the file (archive).
For Batch Extraction in a Folder
To extract all .zip files in a folder into their own
dedicated subfolders, run:
for %i in (*.zip) do 7z x "%i" -o"%~ni"%irepresents the full file name.-o"%~ni"instructs 7-Zip to extract each file into a folder matching only the file's name without its extension.