exit /B 0 does not work

后端 未结 3 1810
有刺的猬
有刺的猬 2020-12-19 06:24

I have the following problem:

I have created a batch script which calls itself in there (for being able to write a log in parallel). In the script I start another pr

3条回答
  •  隐瞒了意图╮
    2020-12-19 06:44

    There's a good explanation of all the options for exiting a batch script here: http://www.robvanderwoude.com/exit.php

    Specifically, from that page:

    The DOS online help (HELP EXIT) doesn't make it clear that the /B parameter exits the current instance of script which is not necessarily the same as exiting the current script. I.e. if the script is in a CALLed piece of code, the EXIT /B exits the CALL, not the script.

    So you definitely don't want exit /b 0 in this case. If just exit 0 doesn't work, try GOTO:EOF.

提交回复
热议问题