samedi 29 février 2020

making a variable dynamic in if statement

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

Aucun commentaire:

Enregistrer un commentaire