Extract a certain file from an archive with 7-Zip from the command line

Solution 1:

You just add the filename at the end.

7z e [archive.zip] -o [outputdir] [fileFilter]

Solution 2:

As a follow-up to surfasb's answer, add a -r flag at the end to recurse:

7z e [archive.zip] -o[outputdir] [fileFilter] -r

Multiple filters support:

7z e [archive.zip] -o[outputdir] [fileFilter_1] [fileFilter_2] -r

Example:

Multiple filters command line:

7z e archive.zip -o outputdir *.xml *.dll -r

PS: I use 7za.exe instead of 7z.exe. This is the actual command I use in my script:

7za.exe x archive.zip -o outputdir *.xml *.pdb *.exe *.ocx *.dll -r