@echo off
set /p ans=
if %ans% == mem goto mem
if %ans% == end goto end
pause
:mem
mem
goto end
:end
echo good bye
应该这样
代码还可以简单化
@echo off
set /p ans=
if %ans% == mem mem
if %ans% == end echo good bye
pause
if "%ans%"=="mem" goto mem
if "%ans%"=="end" goto end