我正在尝试做这样的事情:
@echo off
:beginning
choice /c:123
if %errorlevel%== 1 set test= aaa
if %errorlevel%== 2 set test= bbb
if %errorlevel%== 3 set test= ccc
call :%test%one
pause
goto beginning
:aaaone
echo phrase
exit /b
:bbbone
echo phrase
exit /b
:cccone
echo phrase
exit /b
我正在尝试调用 :%test%one 来调用任何错误级别的输出,但它不会识别 %test% 的变量“test”的输出,并说它找不到标签。有没有办法让用户选择程序调用的内容,而不仅仅是使用“goto(标签)”?提前感谢您提供的任何建议。