Then, when the B.bat is executed, the Hello is assigned to% 1, while the% 0 represents A.bat.
(in batches, you can use%* to represent all the parameters%1-%9 represent 9 parameters, and% 0 for the batch itself, its extended usage is shown in call/?)
Here's how to use goto:eof, such as:
A.bat content:
@echo off
Echo%0%1
Goto:eof
B.bat content:
@echo off
Call A.bat Hello
Dir c \
Pause
Here, after the display of Hello, dir c: \ is executed and paused, and if goto:eof is changed to exit, it will automatically exit when the Hello is displayed. Because the goto:eof will go to the end of A.bat, that is, only exit A.bat and then continue to execute dir; because call A.bat, in the execution of A.bat and B.bat is a cmd window, exit will be directly exited this window, this is goto: The EOF and exit differences.
More ways to use DOS call and start