How can I get Else to work in batch?

So, I play a little with Batch, and I ran into a problem that you guys could help with. So I’m trying to do something that you can answer “Yes” or “No” to the question, and if you do not answer “Yes” or “No”, then he will tell you that this is an invalid 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

Therefore, I cannot use Else the way I did in code, but do you know how I will do the same as Else if it worked? It may seem a bit confusing, hope you can understand. Just to clarify, here is a bit that I don't know how to do:

else goto Invalid
+4
source share
3 answers

else Goto if.

set /p Choice=Is a stone a stone?
if %Choice%==Yes goto Correct
if %Choice%==No goto Incorrect
goto Invalid
+3
0

. ( ), , ELSE . , , ... , . /i . , the else ( . , , .

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

:Correct
echo You are correct!
goto end

:Incorrect
echo You are incorrect!
goto end

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

:end
pause
exit
0

All Articles