Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've been working on a batch file that among other things prompts the user to make a menu selection. I've been using the standard "set /p " command since I'm on XP and choice doesn't exist. Unfortunately, I'm finding that many of the options that I liked about choice don't seem possible with the 'set' command.
Is there any way to give the user say 5 seconds to respond and if they don't, then choose a default item from the menu?
Thanks in advance.
Smokey.
P.S. M2, I've used a ton of your examples so far to make the overall batch file. Thanks a million for all the help you've given others on this site. Much appreciated.

"Is there any way to give the user say 5 seconds to respond and if they don't, then choose a default item from the menu?"
Not that I know of.
I thought CHOICE was included in XP.
Thanks for the encouragement.
=====================================
If at first you don't succeed, you're about average.M2

Can get choice.com from here
http://www.daniel-hertrich.de/wwwlx...
I'll encourage you as well M2.

If you prefer English:
http://golden-triangle.com/CHOICE.COM
=====================================
If at first you don't succeed, you're about average.M2

http://www.ss64.com/nt/timeout.html
Think out of the box.
Use the command and a goto label
__________________________________
Below is just a snipitcls
@echo off
echo.
echo To Start XP Application Loader press A
echo.
echo To Start 2k Application Loader press B
echo.
echo To run but not install tools press C
echo.
echo To just exit this program press X
echo.
echo.
SET Choice=
SET /P Choice= TYPE THE LETTER AND PRESS ENTER: -^>
IF NOT '%Choice%'=='' SET Choice=%Choice%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='a' GOTO :go2
IF /I '%Choice%'=='b' GOTO :go
IF /I '%Choice%'=='c' GOTO :tools
IF /I '%Choice%'=='x' GOTO :exit
echo "%Choice%" IS NOT VALID. PLEASE TRY AGAIN
echo.
:tools
cls
color 2fecho TOOLS
echo ***************************************************************************
echo.
echo Start Everest press A.
echo.
echo Start SIW press B.
echo.
echo Start winfile press C.
echo.
echo Go back to main menu D.
echo.
echo To test sound card E.
echo.
echo Go to Driveragent F.
echo.
echo Majic Jelly Bean G.
echo.
echo Jelly Bean Change key H.
echo.
echo Install sp3 I.
echo.
echo MS Key changer J.
echo.
echo To exit program X.
SET Choice=
SET /P Choice= TYPE THE LETTER AND PRESS ENTER: -^>IF NOT '%Choice%'=='' SET Choice=%Choice%
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='a' GOTO :everest
IF /I '%Choice%'=='b' GOTO :siw
IF /I '%Choice%'=='c' GOTO :manage
IF /I '%Choice%'=='d' GOTO :menu
IF /I '%Choice%'=='e' GOTO :sound
IF /I '%Choice%'=='f' GOTO :agent
IF /I '%Choice%'=='g' GOTO :bean
IF /I '%Choice%'=='h' GOTO :key
IF /I '%Choice%'=='i' GOTO :sp3
IF /I '%Choice%'=='j' GOTO :mskeys
IF /I '%Choice%'=='x' GOTO :exit
:everest
everest.exe
cls
goto :tools:siw
siw.exe
cls
goto :tools:manage
winfile.exe
cls
goto :tools:menu
cls
goto :menue:sound

[1] no point in clearing a var then setting it on the next line
[2] you can save some clutter by losing the
IF /I '%Choice%'=='a' GOTO :go2
and just goto :!choice!
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

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