7Zip – Extract files from all ZIP archives through Batch DOS

If you want to extract all files from (in this case) multiple ZIP files (archives), filtering for some files (using wildmasks *) using 7Zip, you can use this command (looping):

FOR /F "usebackq" %%B in (`DIR /S /B *.zip`) DO (%XMLDIR%\7z.exe x "%%B" -o* -x!sec*.xml -x!remc.*.xml -x!inventory.*.xml -x!c*.xml)

NOTE: You can use the -x! switch to exclude a specific file or a set of files by name, by extension or anything else using the sterisk *;

NOTE:  DIR /S /B *.zip is a command to list full path of any zip file available in the current directory (defined in prompt DOS) and subdirectories;

NOTE: the -o* switch is to create, at runtime, multiple directories of each zip archive during extraction process, with the same proper archive name;

Comments are closed.