Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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?

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 > nulecho Choose [1] [2] or [3]
codescan.com
if errorlevel=4 goto option3
if errorlevel=3 goto option2
if errorlevel=2 goto option1del 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

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.

![]() |
fdisk problem
|
Servies in NT
|

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