提取两个不同的文件,以两个两个不同的文件夹中的一个批处理文件
问题描述:
我有一个批处理脚本,提取两个不同的文件,以两个两个不同的文件夹中的一个批处理文件
unzip.bat with two arguments destination and source zip file.
调用该批次通过传递参数的另一批。
echo %~1
if exist "G:\tett\ITG" (
@RD /S /Q "G:\tett\ITG"
)
if exist "G:\tett\pylib" (
@RD /S /Q "G:\tett\pylib"
)
unzip.bat "G:\tett\" "G:\test\test.zip"
unzip.bat "G:\tett\" "G:\test\pylib.zip"
我可以看到最后一行没有执行pls help。提前致谢!
答
下,没有验证基本的脚本,应该这样做:
@Echo Off
For %%A In ("ITG","pylib") Do If Exist "G:\tett\%%~A\" RD/S/Q "G:\tett\%%~A"
For %%A In ("test","pylib"
) Do If Exist "G:\test\%%~A.zip" Call "unzip.bat" "G:\tett\" "G:\test\%%~A.zip"
从Call/?
“从另一个调用一个批处理程序。”
'CALL unzip.bat“G:\ tett \”“G:\ test \ test.zip”' – JosefZ
@JosefZ Please,post as a answer。这是一个反复出现的问题,但你的回答可能会帮助其他人,对吗? –