How would I make Else work in Batch?

Viewed 69

So, I'm playing around with Batch a little bit and I've encountered a problem that I think you guys could help with. So I'm trying to make a thing where you can answer Yes or No on a question, and if you don't answer Yes nor No then it'll tell you that it wasn't a valid answer. You can take a look at the code right here.

:Choice
set /p Choice=Is a stone a stone?
if %Choice%==Yes goto Correct
if %Choice%==No goto Incorrect
else goto Invalid

:Correct
echo You are correct!
pause
goto end

:Incorrect
echo You are incorrect!
pause
goto end

:Invalid
echo You did not enter a valid answer.
pause
goto end

:end
exit

So I cannot use Else in the way I've done in the code, but do you know how I would do the same thing as Else would do IF it worked? May sound a little confusing, I hope you understand. Just to clarify, here's the bit I don't know how to do:

else goto Invalid
3 Answers
Related