Home » Questions » Computers [ Ask a new question ]

Exit batch file from subroutine

Exit batch file from subroutine

How can I exit a batch file from inside a subroutine?

Asked by: Guest | Views: 36
Total answers/comments: 1
Guest [Entry]

"If you do not want to come back from the procedure, don't use call: instead use goto.

@echo off
ECHO Quitting...
GOTO :QUIT
ECHO Will never be there!
GOTO END

:QUIT
EXIT /B 1

:END
EXIT /B 0"