2017-10-17 30 views
0

我有一個批處理腳本,提取兩個不同的文件,以兩個兩個不同的文件夾中的一個批處理文件

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。提前致謝!

+0

'CALL unzip.bat「G:\ tett \」「G:\ test \ test.zip」' – JosefZ

+0

@JosefZ Please,post as a answer。這是一個反覆出現的問題,但你的回答可能會幫助其他人,對嗎? –

回答

0

下,沒有驗證基本的腳本,應該這樣做:

@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/? 「從另一個調用一個批處理程序。」

相關問題