且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

蝙蝠文件终止

更新时间:2023-02-02 21:27:30

批处理文件具有单个执行上下文.当您像这样嵌套批处理文件调用时,嵌套文件将完全替换外部/父批处理文件的上下文.没有记录表明存在父批处理文件,因此您只需在内部文件完成后返回提示即可.

Batch files have a single execution context. When you nest batchfile calls like that, the nested file completely replaces the outer/parent batch file's context. There's no record saying that there was a parent batch file, so you simply return to the prompt when the inner file completes.

要能够返回外部批处理文件,您必须

To be able to return to the outer batch file, you have to do

 echo Before
 call inner.bat
 echo After