2

I see various posts/answers around this topic but the answers did not work.

Environment:

  • Windows 10
  • 64-bit
  • 7-zip is located in c:\program files\7-Zip

I have a folder d:\zipfiles with many *.zip files

I want to unzip all zip files in this folder to their respective sub-folders

carrabino
  • 141

2 Answers2

2

This Windows command line works as of 2023:

for /r %f in (*.zip) do 7z x %f -o*

This assumes that the 7z.exe is available in your path.

If 7-zip is not in in your system path:

Option 1:

Replace 7z with the full path to the file "c:\program files\7-zip\7z.exe" in the above code, like this:

for /r %f in (*.zip) do "c:\program files\7-zip\7z.exe" x %f -o*

Option 2:

Edit the Windows "system environment variables", and add the 7-Zip folder to the list:

  • click the Search icon (bottom left of taskbar)
  • enter "edit the system environment variables"
  • windows will open "System Properties"
  • Click "Environment Variables" button (bottom right)
  • Find the "Path" item in the top section, and click Edit...
  • Check if 7-Zip is listed (most likely not), if not, click New button
  • Enter where your Z-Zip app is installed (e.g. C:\Program Files\7-Zip)
  • Click OK
carrabino
  • 141
1

You could also do it via the GUI by selecting the *.zip files to extract, then right click -> 7-Zip (provided it is in the context menu) -> Extract files... -> then specify "*" in the following field (corresponding to the -o* command line option):

enter image description here

divaylo
  • 51