Computing.Net > Forums > Disk Operating System > DOS menu in batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS menu in batch file

Reply to Message Icon

Name: Rob
Date: February 26, 2002 at 08:52:47 Pacific
Comment:

I am creating a DOS batch file that will automatically run when a user puts a disk into the CD ROM.
I will prompt the user for 1 of 3 options. This will in turn point to a specific folder on the CD ROM and run a setup within that folder.
My problem is I have to support Windows 95,98,NT,2000,and ME.
According to Microsoft, WIndows 2000 does not support the "Choice" command for MS-DOS, which does not allow me to pick something from the menu and assign it.
Is there another command available that will assign what the user has picked to a variable or something so I can point to the appropriate folder?



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: February 26, 2002 at 15:50:17 Pacific
Reply:

Try this:

=== SCRIPT BEGIN ===

:: Thanks to Laurence Soucy
:: for codescan.com !

ECHO A 100 >%temp%.\$$tmp.dat
ECHO MOV AH,0>>%temp%.\$$tmp.dat
ECHO INT 16>>%temp%.\$$tmp.dat
ECHO MOV AL,AH>>%temp%.\$$tmp.dat
ECHO MOV AH,4C>>%temp%.\$$tmp.dat
ECHO INT 21>>%temp%.\$$tmp.dat
ECHO. >>%temp%.\$$tmp.dat
ECHO RCX>>%temp%.\$$tmp.dat
ECHO A>>%temp%.\$$tmp.dat
ECHO N %temp%.\codescan.com>>%temp%.\$$tmp.dat
ECHO W>>%temp%.\$$tmp.dat
ECHO Q>>%temp%.\$$tmp.dat
DEBUG.EXE < %temp%.\$$tmp.dat > nul

echo Choose [1] [2] or [3]
codescan.com
if errorlevel=4 goto option3
if errorlevel=3 goto option2
if errorlevel=2 goto option1

del codescan.com
del %temp%.\$$tmp.dat

=== SCRIPT END ===

When codescan.com is runned, it "pauses" system, waiting for a keystroke. Each key will return a different errorlevel. Then you may use those errorlevels. The only problem is that I don't see any logic sequence in most of the errorlevels (a=30 but b=48...)

However, in Win2K you may easely discover the errorlevel for each key: run codescan.com, hit a key then make "echo %errorlevel%"

Did you understand everything ?

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 2
Name: Anonymous
Date: July 8, 2002 at 23:46:38 Pacific
Reply:

Errorlevels in codescan.com are based on the layout of your keyboard.

Q=16
W=17
E=18
R=19
T=20
Y=21
...etc.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


fdisk problem Servies in NT



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: DOS menu in batch file

dos color in batch file? www.computing.net/answers/dos/dos-color-in-batch-file/9720.html

Suppress Or Hide Dos Screen In Batch File www.computing.net/answers/dos/suppress-or-hide-dos-screen-in-batch-file/5434.html

user imput in batch files. www.computing.net/answers/dos/user-imput-in-batch-files/3282.html