The code could be something like this:
@echo off
set /p var=Choose a option ('s' to start, 'q' to quit):
if %var%==q goto:eof
echo working!
In this sample, if you enter 'q', "working!" will not be printed, because you go to the end of the script. You also can use functions with batch files (!). Please see my recent answer:
Batch variable equations[
^].
Chances are, your code already works correctly; but you probably you haven't started command interpreted, so it was not closed, but the console of you batch was closed. If you started it with CMD.EXE and then started your batch from the command line. Or, alternatively, start it with "CMD /K your_script_batch". Again, please see the help created by the script I referenced in my previous answer.
—SA