Why does calling a nested batch file without prepending “call” to the line exit the parent batch file?

前端 未结 3 1526
挽巷
挽巷 2020-12-17 07:45

I understand how to call nested batch files from within a parent file using the call command, as there are plenty of resources on that:

  • CALL
3条回答
  •  無奈伤痛
    2020-12-17 08:37

    Call is basically saying "go execute this other batch file, and then come back here and continue". It has been there since DOS 3.3 or so, and if it were removed now would break all backward-compatibility (which is why people are still using batch scripts). It can also be used to branch to :link locations.

    For info on the use and syntax (for future reference for others), you can see this MS TechNet link

    If you need new functionality, use CMD scripts or PowerShell scripts instead.

提交回复
热议问题