|
1980623
初级用户
 
积分 25
发帖 7
注册 2006-10-13
状态 离线
|
『楼 主』:
学习CHOICE时遇到一个问题
使用 LLM 解释/回答一下
尝试用CHOICE编辑批处理文件,但在XP下无法实验,总是提示:'CHOICE' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
请问我该怎么办????
──────────────── 版务记录 ────────────────
执行:namejm
原标题:学习CHOICE时遇到一个问题
说明: 因标题过于模糊,不便于论坛的搜索和管理,请在三日内修改标题。
提示:修改标题请在当前帖的右下脚点 编辑, 修改完毕之后按 编辑帖子 即可。
处罚:因属论坛新人,暂时不予处罚;若三日之后尚未修改标题,将扣除2点积分,
以示惩罚,并由版主强制修改标题。请点击这里阅读论坛发帖规定,以避免在
今后的讨论中违规发帖。
──────────────── 版务记录 ────────────────
Last edited by namejm on 2006-11-20 at 10:59 PM ]
Try to edit batch files with CHOICE, but can't experiment under XP, always prompts: 'CHOICE' is not an internal or external command, nor is it a runnable program or batch file.
What should I do????
──────────────── Moderation Record ────────────────
Execution: namejm
Original title: Encounter a problem when learning CHOICE
Description: The title is too vague, which is not conducive to forum search and management, please modify the title within three days.
Prompt: To modify the title, please click Edit at the bottom right of the current post, after modification, press Edit Post
Penalty: As a new forum user, temporarily no penalty; if the title is not modified after three days, 2 points will be deducted as punishment, and the moderator will force the title modification. Please click here to read the forum posting regulations, so as to avoid violating the regulations in future discussions.
──────────────── Moderation Record ────────────────
Last edited by namejm on 2006-11-20 at 10:59 PM ]
此帖被 +1 点积分 点击查看详情 评分人:【 】 | 分数: +1 | 时间:2009-2-21 00:40 |
|
|
|
2006-10-21 22:28 |
|
|
zerocq
中级用户
  
积分 458
发帖 196
注册 2006-10-5
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
貌似XP不是默认安装choice:P
It seems that XP is not installed with choice by default:P
|
|
2006-10-22 00:09 |
|
|
1980623
初级用户
 
积分 25
发帖 7
注册 2006-10-13
状态 离线
|
|
2006-10-22 00:42 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
给你压了一个 Windows Server 2003 的 choice.exe ,
COPY到你的XP下面,看看能不能用:)
C:\TEMP>choice.exe /?
CHOICE
描述:
该工具允许用户从选择列表选择一个项目并返回所选项目的索引。
参数列表:
/C choices 指定要创建的选项列表。默认列表是 "YN"。
/N 在提示符中隐藏选项列表。提示前面的消息得到显示,
选项依旧处于启用状态。
/CS 允许选择分大小写的选项。在默认情况下,这个工具
是不分大小写的。
/T timeout 做出默认选择之前,暂停的秒数。可接受的值是从 0
到 9999。如果指定了 0,就不会有暂停,默认选项
会得到选择。
/D choice 在 nnnn 秒之后指定默认选项。字符必须在用 /C 选
项指定的一组选择中; 同时,必须用 /T 指定 nnnn。
/M text 指定提示之前要显示的消息。如果没有指定,工具只
显示提示。
/? 显示帮助消息。
注意:
ERRORLEVEL 环境变量被设置为从选择集选择的键索引。列出的第一个选
择返回 1,第二个选择返回 2,等等。如果用户按的键不是有效的选择,
该工具会发出警告响声。如果该工具检测到错误状态,它会返回 255 的
ERRORLEVEL 值。如果用户按 Ctrl+Break 或 Ctrl+C 键,该工具会返回 0
的 ERRORLEVEL 值。在一个批程序中使用 ERRORLEVEL 参数时,将参数降
序排列。
示例:
CHOICE /?
CHOICE /C YNC /M "确认请按 Y,否请按 N,或者取消请按 C。"
CHOICE /T 10 /C ync /CS /D y
CHOICE /C ab /M "选项 1 请选择 a,选项 2 请选择 b。"
CHOICE /C ab /N /M "选项 1 请选择 a,选项 2 请选择 b。"
I've pressed a choice.exe for Windows Server 2003 for you. Copy it to your XP and see if it can be used :)
C:\TEMP>choice.exe /?
CHOICE
Description:
This tool allows the user to select an item from a choice list and returns the index of the selected item.
Parameter List:
/C choices Specifies the list of options to create. The default list is "YN".
/N Hides the option list in the prompt. The message preceding the prompt is displayed, and the options remain enabled.
/CS Allows case-sensitive options to be selected. By default, this tool is case-insensitive.
/T timeout The number of seconds to pause before making the default selection. Acceptable values are from 0 to 9999. If 0 is specified, there will be no pause and the default option will be selected.
/D choice Specifies the default option after nnnn seconds. The character must be in the set of choices specified with /C; also, /T must be used to specify nnnn.
/M text Specifies the message to display before the prompt. If not specified, the tool only displays the prompt.
/? Displays help message.
Note:
The ERRORLEVEL environment variable is set to the key index selected from the choice set. The first choice listed returns 1, the second returns 2, and so on. If the key pressed is not a valid choice, the tool beeps. If the tool detects an error condition, it returns an ERRORLEVEL value of 255. If the user presses Ctrl+Break or Ctrl+C, the tool returns an ERRORLEVEL value of 0. When using the ERRORLEVEL parameter in a batch program, order the parameters in descending order.
Examples:
CHOICE /?
CHOICE /C YNC /M "Press Y to confirm, N to reject, or C to cancel."
CHOICE /T 10 /C ync /CS /D y
CHOICE /C ab /M "Select a for option 1, b for option 2."
CHOICE /C ab /N /M "Select a for option 1, b for option 2."
附件
1: choice.rar (2006-10-22 01:12, 16.41 KiB, 下载附件所需积分 1 点
,下载次数: 150)
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-10-22 01:12 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
XP下本身没有自带这个choice命令吧。
我也下下来试试~
The choice command is not built-in in XP by default, right?
I'll also download it and give it a try~
|
|
2006-10-22 01:16 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Vista也支持choice了,看来微软真正很难make a choice啊
Vista also supports choice, it seems that Microsoft really has a hard time making a choice
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-22 04:03 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-10-22 08:59 |
|
|
elantra
新手上路

积分 10
发帖 5
注册 2006-10-30
状态 离线
|
|
2006-10-30 07:01 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
@echo off
set /p a=请输入你要赋给变量a的值:
echo %a%
pause
@echo off
set /p a=Please enter the value you want to assign to variable a:
echo %a%
pause
|
|
2006-10-30 07:10 |
|
|
elantra
新手上路

积分 10
发帖 5
注册 2006-10-30
状态 离线
|
|
2006-10-30 07:13 |
|
|
elantra
新手上路

积分 10
发帖 5
注册 2006-10-30
状态 离线
|
|
2006-10-30 07:14 |
|
|
wujialiang
新手上路

积分 2
发帖 1
注册 2006-3-16
状态 离线
|
|
2006-11-21 09:23 |
|
|
baepyygy
初级用户
 
积分 142
发帖 61
注册 2006-6-1
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
可以把win2003下的choice命令复制到XP下。。
You can copy the choice command under Win2003 to XP.
|
|
2006-11-21 09:40 |
|
|
lindati
新手上路

积分 2
发帖 1
注册 2006-10-30
状态 离线
|
|
2007-4-14 00:31 |
|
|
lvtree
新手上路

积分 2
发帖 1
注册 2007-4-27
状态 离线
|
『第 15 楼』:
choice.exe,你在哪里啊
使用 LLM 解释/回答一下
我也遇到这样的问题:
尝试用CHOICE编辑批处理文件,但在XP下无法实验,总是提示:'CHOICE' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
I also encountered such a problem:
Try to use CHOICE to edit a batch file, but it cannot be experimented under XP. It always prompts: 'CHOICE' is not an internal or external command, nor is it a runnable program or batch file.
|
|
2007-4-27 06:00 |
|