0

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

Piriwn1
  • 31
  • 3
  • 2
    `set "!choice!=%choice%"` choice already conyains the number. There is no need for delayed expansion. –  Feb 29 '20 at 23:50
  • alright so i guess where I'm setting the %filex% inst working – Piriwn1 Mar 01 '20 at 00:08
  • 3
    There is no need for this line of code: `set "!choice!=%choice%"` as the variable is already set but the code is also wrong. With your start command you will want to do this. `start "" "!file%choice%!"` – Squashman Mar 01 '20 at 01:00

0 Answers0