Board logo

标题: [其他] 批处理choice命令可以选择十个数吗? [打印本页]

作者: dantesky    时间: 2019-12-15 21:00     标题: 批处理choice命令可以选择十个数吗?

  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的时候并没有退出
作者: terse    时间: 2019-12-15 23:07

用A  choice /c:123456789A/n  /m 。。。。
下面判断是10




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2