找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 19164|回复: 1

[其他] 批处理choice命令可以选择十个数吗?

[复制链接]
发表于 2019-12-15 21:00:34 | 显示全部楼层 |阅读模式
  1. choice /c:1234567890 /n /m "请按键1、2、3、4、5、6、7、8、9、0 选择功能"
  2. if %errorlevel%==1 goto test1
  3. if %errorlevel%==2 goto test2
  4. if %errorlevel%==3 goto test3
  5. if %errorlevel%==4 goto test4
  6. if %errorlevel%==5 goto test5
  7. if %errorlevel%==6 goto test6
  8. if %errorlevel%==7 goto test7
  9. if %errorlevel%==8 goto test8
  10. if %errorlevel%==9 goto test9
  11. if %errorlevel%==0 goto et
  12. 中间省略了
  13. :et
  14. exit
复制代码
这个选择1-9都正常,但是选择0的时候并没有退出
发表于 2019-12-15 23:07:21 | 显示全部楼层
用A  choice /c:123456789A/n  /m 。。。。
下面判断是10
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-19 12:02 , Processed in 0.020306 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表