Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 递归搜索并复制所有zip文件中的特定文件_Windows_Batch File_Zip - Fatal编程技术网

Windows 递归搜索并复制所有zip文件中的特定文件

Windows 递归搜索并复制所有zip文件中的特定文件,windows,batch-file,zip,Windows,Batch File,Zip,我正在尝试使用Windows批处理脚本从多个zip存档中移动文件 我有一个文件列表(test.txt、test2.txt等)存储在zip归档文件中 我想在所有zip档案中搜索每个文件,然后将它们复制到另一个目录 理想情况下,不应从存储这些文件的原始zip存档中删除这些文件 我的尝试失败了 @echo off rem Prepare environment setlocal enableextensions disabledelayedexpansion set content=test.txt

我正在尝试使用Windows批处理脚本从多个zip存档中移动文件

我有一个文件列表(test.txt、test2.txt等)存储在zip归档文件中

我想在所有zip档案中搜索每个文件,然后将它们复制到另一个目录

理想情况下,不应从存储这些文件的原始zip存档中删除这些文件

我的尝试失败了

@echo off
rem Prepare environment
setlocal enableextensions disabledelayedexpansion

set content=test.txt;test2.txt;test3.txt

for %%u in (%content%) do call :doextractzip %%u
goto :eof

:doextractzip
for /R "c:\temp\ziptest" %%A in ("*.zip") do (
  call "c:\Program Files\7-Zip\7z.exe" e %%A -oc:\temp\ziptest %%u -r
)
goto :eof
它工作正常,但是我想从外部txt文件调用内容

另外,我想知道是否有更好的解决方案


非常感谢您提供的任何帮助

您使用什么控制台zip程序来打开zip文件?只要在internet上搜索一下,您就会发现@Squashman我使用的是7zip,但会接受一种通用方法。@LotPings谢谢。有趣但powershell脚本并不完全相同。我对严格的windows脚本(dos)解决方案感兴趣。您使用什么控制台zip程序来打开zip文件?只要在internet上搜索一下,您就会发现@Squashman我使用的是7zip,但会接受一种通用方法。@LotPings谢谢。有趣但powershell脚本并不完全相同。我对严格的windows脚本(dos)解决方案感兴趣。