You are not logged in.
Hi
How to better end batch script exit / b or goto: eof?
Offline
If you need to set the ERRORLEVEL for the script (or a subroutine) then you should use exit /b [number].
Otherwise they are pretty much interchangeable in my experience (happy to be corrected on this though) – so use whichever you prefer the look of I guess.
Last edited by bluesxman (02 May 2019 09:45)
cmd | *sh | Ruby | Chef
Offline
I used to end subroutines (called by call) via exit /B, and end the main program (called at the command-prompt) via goto :EOF
Antonio
Last edited by Aacini (02 May 2019 20:49)
Offline
Other than being able to return an ERRORLEVEL, I think that the only difference is that EXIT will work even if Command Extensions are disabled, thats a pretty rare edge case though.
Offline