Can anyone help please? I have a problem with something that used to
be easy with the CHOICE command in Win9x batch files, but I think I
must be missing something, as I can't find out how to do it using SET /
P, the replacement in WIN XP. Does anybody know if and how to get a
batch file to wait a limited time for user input, and to use a default
value
instead, if the time expires without user input? I thought it might be
possible to do something equivalent to
SET /P:30,Y choice=Enter your choice
(where it would wait 30s and then choose Y by default)
I know this syntax is just made up, its just an example of what I was
trying to do,
but does anybody know how I would go about doing this sort of thing? I
can't
find any relevant documentation anywhere .... any advice very
gratefully received!
Thanks very much!
Why don't you get the choice.exe from a Windows 98 CD, or download
Windows NT 3.5 Resource Kit which contains CHOICE.EX_ (needs EXPANDing
to choice.exe) from Microsoft Ftp site:
i386.exe (self extracting archive)
ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt35/i386/i386.exe
All the best, Timo
--
Prof. Timo Salmi mailto:t...@uwasa.fi ftp & http://garbo.uwasa.fi/
Hpage: http://www.uwasa.fi/laskentatoimi/english/personnel/salmitimo/
Department of Accounting and Finance, University of Vaasa, Finland
Useful script files and tricks ftp://garbo.uwasa.fi/pc/link/tscmd.zip
> 14} Help! My old batch files won't work since there is no choice.com
> http://www.netikka.net/tsneti/info/tscmd014.htm
>
> All the best, Timo
Just to expand a little on Timo's response:
You can use CHOOSE.EXE from
TSUTLF17.zip - http://garbo.uwasa.fi/pub/pc/ts/tsutlf17.zip
Or
TSCMD.ZIP - http://garbo.uwasa.fi/pub/pc/link/tscmd.zip
Usage: CHOOSE [/c[:]keys] [/?|/h] [/n] [/s] [/t[:]c,nn] [/x] [text]
the prompt keys ─┘ │ │ │ │ │ │ │
Help ─┘ │ │ │ │ │ │
No default prompt (only user text) ─┘ │ │ │ │ │
apply case Sensitivity ─┘ │ │ │ │
default key after timeout (must be among keys) ─┘ │ │ │
Timeout in seconds ─┘ │ │
Output @set choose_=returnCode ─┘ │
user's text prompt ─┘
An Example of which can be found here