[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Autoexec.nt commands



** Reply to message from Harry Binswanger  on
Wed, 22 Aug 2007 22:30:35 -0400

Yeah, CHOICE.EXE is part of the Reskit, and not a free part
either; but CHOICE.COM was bundled with 9x, is widely available,
and it works (sort of) in NT, although it's a huge resource hog.
A free alternative is SET /P, which I use widely in public
scripts. The main difference between SET /P and CHOICE is that
SET /P requires a carriage return after your keystroke, whereas
CHOICE responds immediately to a keystroke. (Often it's an
advantage to have that "confirmation keystroke".) Something
like this:

@echo off
::CHOICE.BAT
::Works w/Win95CMD (KMD.EXE) ergo cross-platform
set /p oui=Respond Yes or No (y/N):
if %oui%!==! set oui=N
if %oui%==y set oui=Y
if %oui%==Y echo OK
if not %oui%==Y echo Not OK

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------