I'm trying to write a batch file that will display a list to the user, have them enter their choice, and then do something. Here's what I have now:
@echo off
echo 1. BL (main)
echo 2. BL (sound)
echo 3. MS-DOS
choice /C:123 /N
set os=%errorlevel%
if "%os%"=="1" echo hello1
if "%os%"=="2" echo hello2
if "%os%"=="3" echo hello3
The problem is that nothing is put into os. When I try printing errorlevel after the choice line it doesn't print anything, but shouldn't it be equal to the user's choice? I'm using MS-DOS 6, if it matters.
Thanks!