中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-01 19:03
48,037 topics / 350,122 posts / today 2 new / 48,249 members
DOS批处理 & 脚本技术(批处理室) » Original: CHOICE.EXE 2K3版本经典例子
Printable Version  1,776 / 4
Floor1 secowu Posted 2006-03-07 18:00
初级用户 Posts 92 Credits 201
:
:start
cls
color 2F
echo. ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
echo.
echo Please choose whether to shut down immediately
echo. ----------------------
echo Automatically select for: immediate in 8 seconds
echo. ----------------------
echo Please enter (Y immediate/N later) to choose
echo.
echo. ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
choice /c:YN /d Y /t 8 /N

if errorlevel 255 goto start
if errorlevel 2 goto a
if errorlevel 1 goto b
if errorlevel 0 goto start

:b
color 2F
echo.
echo.
echo You chose to shut down immediately
shutdown -s -t 0
exit

:a
color f2
echo.
echo.
echo You chose to shut down later
shutdown -a
exit
Floor2 taoty Posted 2006-03-07 22:57
中级用户 Posts 112 Credits 275
Come in to learn.
Floor3 gorwoo Posted 2006-03-11 21:41
新手上路 Posts 2 Credits 7
Can you give a detailed explanation of the specific parameters of CHOICE?
Floor4 bagpipe Posted 2006-03-13 10:55
银牌会员 Posts 425 Credits 1,144 From 北京
CHOICE version 4.1, Copyright (C) 1994--2003 Jim Hall, jhall@freedos.org
Waits for the user to press a key, from a list of choices
Usage: CHOICE choices ] c,nn ]
/B - Sound an alert (beep) at prompt
/Cchoices - Specifies allowable keys. Default is: yn
/N - Do not display the choices at end of prompt
/S - Be case-sensitive
/Tc,nn - Automatically choose key c after nn seconds
text - The text to display as a prompt

People with poor English skills, those who can read English but can't translate, and those who can translate but don't do menial work don't apply........
Floor5 hong138 Posted 2010-09-22 07:57
新手上路 Posts 4 Credits 7
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023