Você pode usar a opção -i
com o 7-Zip para isso. Como exemplo, a seguinte modificação do seu arquivo de lote irá extrair somente .txt
arquivos.
@ECHO ON
SET source=C:\Users\user\Desktop\test
FOR /F "TOKENS=*" %%F IN ('DIR /S /B "%source%\*.zip"') DO "C:\Program Files-Zipz.exe" x "%%~fF" -o"C:\Users\user\Desktop\Working\Custom Textures\*" -ir!*.txt
FOR /F "TOKENS=*" %%F IN ('DIR /S /B "%source%\*.7z"') DO "C:\Program Files-Zipz.exe" x "%%~fF" -o"C:\Users\user\Desktop\Working\Custom Textures\*" -ir!*.txt
FOR /F "TOKENS=*" %%F IN ('DIR /S /B "%source%\*.rar"') DO "C:\Program Files-Zipz.exe" x "%%~fF" -o"C:\Users\user\Desktop\Working\Custom Textures\*" -ir!*.txt
PAUSE
Aqui estão mais algumas informações da documentação :
-i (Include filenames) switch
Specifies additional include filenames and wildcards.
Multiple include switches are supported.
Syntax
-i[<recurse_type>]<file_ref> <recurse_type> ::= r[- | 0] <file_ref> ::= @{listfile} | !{wildcard}
Parameters
<recurse_type>
Specifies how wildcards and file names in this switch must be used. If this option is not given, then the global value, assigned by the -r (Recurse) switch will be used. For more details see specification of the -r (Recurse) switch.
<recurse_type> ::= r[- | 0]
<file_ref>
Specifies filenames and wildcards, or a list file, for files to be processed.
<file_ref> ::= @{listfile} | !{wildcard} Option Description {listfile} Specifies name of list file. See List file description. {wildcard} Specifies wildcard or filename.
Examples
7z a -tzip src.zip *.txt -ir!DIR1\*.cpp
adds to src.zip archive all *.txt files from current directory and all *.cpp files from directory DIR1 and from all it's subdirectories.