making a variable dynamic in if statement

别说谁变了你拦得住时间么 提交于 2020-03-04 15:35:53

问题


I am trying to do the bellow:

setlocal enabledelayedexpansion
set choice=
set /p choice="Select File Number, or no to exit: "

if "%choice%"=="no" (
goto cleanup
) else (
set "!choice!=%choice%"
start %file!choice!%
pause
)

what i want is to open a file where the variable is %filex% and be able to choose what file to open

来源:https://stackoverflow.com/questions/60470710/making-a-variable-dynamic-in-if-statement

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!