用一個bat文件調用另外兩個bat文件,當1.bat執行完后再執行2.bat
摘自:https://zhidao.baidu.com/question/492732911.html
@echo off
start d:\1.bat
start c:\2.bat
這樣是2個任務同時執行,應該怎么改,謝謝
@echo off start /wait d:\1.bat start /wait c:\2.bat @echo off call d:\1.bat call c:\2.bat
start 是在新窗口運行調用的文件,call是在當前的窗口運行。 start /wait是指啟動應用程序並等待其結束
順序執行bat的方式是使用call xxx.bat
1 @echo off 2 3 :: 獲取當前目錄絕對路徑 4 ::set current_path="%cd%" 5 6 set CUSTOM_PROJECT=MD702G_FT 7 echo "=======./build_MD702G_FT.bat running.=================================%current_path%" 8 ::xcopy .\projects\%CUSTOM_PROJECT% . /Y /S 9 call .\liuyan.bat 10 ::make custom=ULTRA2503D_11C gprs %* 11 call .\make_FT.bat gprs %* 12 13 ::拷貝程序包, 發布 14 cd %current_path% 15 call .\3_ft_copy.bat
