例如,如果我有两个批处理文件,A1和A2,在同一个文件夹中,我想从A1加载A2,如下面的代码:
::This is a program loader
::A2.bat is another batch file within the same folder
title A1
@echo off
choice /m "Do you wish to proceed?"
if errorlevel 1 start A2.bat
if errorlevel 2 exit
我知道它会在新窗口中打开A2.bat,但无论如何我可以在A1.bat的现有窗口中打开A2.bat吗?感谢
答案 0 :(得分:4)
使用call
代替start
:
::This is a program loader
::A2.bat is another batch file within the same folder
title A1
@echo off
choice /m "Do you wish to proceed?"
if errorlevel 1 CALL A2.bat
if errorlevel 2 exit
答案 1 :(得分:-2)
start /b A2.bat
将运行A2.bat而不创建新窗口