I am trying to figure out how to do a choice command in Windows NT.
My batch file in Windows 98 contains a lines as follows
::CHOICE TO CONTINUE OR NOT
choice /n Do you wish to Continue (Y or N) ?
if errorlevel 2 GOTO STOPPROG
if errorlevel 1 GOTO CHECK2
I have tried several attempts using the IF command and SET command .. but
can't seem to get it to work. I discovered that SET /p does not work on
NT.. so does anyone out there know how I can do a simple choice Y or N
without using the Choice command. Windows NT ...I know can use it .. but
the NT boxes I am putting the batch file on don't have it installed .. and
I know Choice can cause issues with NT.. so I don't want to use it at all..
Any help on this would be greatly appreciated.
Forever in your debt ...
Tina : )
========begin file C:\CMD\DEMO\CONTINUE.CMD==================================
001. @echo off
002. ::
003. :: this is an example of displaying a prompt and reading
004. :: the user response into a variable
005. ::
006. setlocal
007. set msg=
008. :ask
009. echo.%msg%
010. echo.
011. set msg=
012. call rdstring response "Do you wish to Continue (Y or N) ?"
013. if not defined response goto :ask
014.
015. if /i "%response:~0,1%" EQU "Y" goto :Yes
016. if /i "%response:~0,1%" EQU "N" goto :No
017. set msg=[%response%] is not a valid response. Please reply with 'Y' or 'N'.
018. goto :ask
019. :Yes
020. echo OK, we decided we want to continue.
021. goto :EOF
022. :No
023. echo Nope, we decided not to continue.
024. goto :EOF
========end file C:\CMD\DEMO\CONTINUE.CMD==================================
========begin file C:\CMD\TEST\RDSTRING.CMD==================================
001. @echo off
002. ::
003. :: originally developed by Walter Zackery
004. ::
005. setlocal
006. set target=%1
007. set myprompt="""%2"""
008. set myprompt=%myprompt:""""=%
009. set myprompt=%myprompt:"""=%
010. echo.
011. echo %myprompt%
012. for /f "tokens=*" %%a in (
013. 'format/f:160 a: ^|find "..."') do set input=%%a
014. endlocal&set %target%=%input:~30%&goto :EOF
015. :EOF
========end file C:\CMD\TEST\RDSTRING.CMD==================================
--
u n z i p m y a d d r e s s t o s e n d e - m a i l
@echo off
echo
Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>getkey.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY
Wv;ovBX2Gv0ExGIuht6>>getkey.com
echo L?p{KsUWK`LR0>>getkey.com
getkey.com
if errorlevel 89 if not errorlevel 90 echo Y key pressed
if errorlevel 121 if not errorlevel 122 echo y key pressed
if errorlevel 78 if not errorlevel 79 echo N key pressed
if errorlevel 110 if not errorlevel 111 echo n key pressed
del getkey.com
::--------------------------------------------------------
The source code:
; read character from keyboard and return ascii
; value as errorlevel
@=$100
eor.w r0,r0
trap #$16
move.b #$4c,m0
trap #$21
Tina Gollner wrote:
>
> Hi,
>
> I am trying to figure out how to do a choice command in Windows NT.
> My batch file in Windows 98 contains a lines as follows
>
> ::CHOICE TO CONTINUE OR NOT
> choice /n Do you wish to Continue (Y or N) ?
> if errorlevel 2 GOTO STOPPROG
> if errorlevel 1 GOTO CHECK2
>
@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>getkey.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUYWv;ovBX2Gv0ExGIuht6>>getkey.com
Tina Gollner wrote:
>
> Hi,
>
> I am trying to figure out how to do a choice command in Windows NT.
> My batch file in Windows 98 contains a lines as follows
>
> ::CHOICE TO CONTINUE OR NOT
> choice /n Do you wish to Continue (Y or N) ?
> if errorlevel 2 GOTO STOPPROG
> if errorlevel 1 GOTO CHECK2
@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>getkey.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>>getkey.com
...snipped
> @echo off
> echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>getkey.com
> echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>>getkey.com
> echo L?p{KsUWK`LR0>>getkey.com
>
> getkey.com
> if errorlevel 89 if not errorlevel 90 echo Y key pressed
> if errorlevel 121 if not errorlevel 122 echo y key pressed
> if errorlevel 78 if not errorlevel 79 echo N key pressed
> if errorlevel 110 if not errorlevel 111 echo n key pressed
> del getkey.com
>
Cool. Thanks.
--
<!-Outsider//->
MS-DOS 6.22, Windows for Workgroups 3.11, Netscape Communicator 4.08
Herbert Kleebauer <kl...@unibwm.de> wrote in message news:<3C17168D...@unibwm.de>...
search for decide.exe