Solved Multiple 7z extraction (extract to directory with same name)

March 2, 2013 at 10:32:12
Specs: Windows XP
prgms\7za.exe e 7z_dir\0B909427.7z -o"%userprofile%"\desktop\7extract\0B909427 *.* -x!*.*_ -x!*.txt -r

NOTE: The command above is for a single 7-zip file for which i need to use for multiple files

I need help extracting all 7z files in the 7z_dir directory and each 7-zip archive extracts to a folder with the same name as the 7-zip file.

	< extracted files from 0B909427.7z >
	< extracted files from A4776B43.7z >
	< extracted files from 0B258427.7z >
	< extracted files from 76BA4743.7z >

Thanks in advance to anyone who can help.

See More: Multiple 7z extraction (extract to directory with same name)

Report •

March 2, 2013 at 12:03:43
✔ Best Answer
@echo off & setlocal
for %%a in (7z_dir\*.7z) do (
prgms\7za.exe e 7z_dir\%%a -o"%
userprofile%"\desktop\7extract\%%~na *.* -x!*.*_ -x!*.txt -r
::==== end
You can run it from 7z_dir or from one level up from 7z_dir, as written.

Report •

March 3, 2013 at 04:53:12
Thanks for your help nbrane

Below is the code i used

@echo off 

SET OUTDIR="%USERPROFILE%\desktop\7extract"

for %%a in (%SRCDIR%\*.7z) do (prgms\7za.exe e %SRCDIR%\%%~na.7z -o%OUTDIR%\%%~na *.* -x!*.*_ -x!*.txt -y -r)

Report •
Related Solutions

Ask Question