Board logo

标题: 窗口五颜六色的闪烁的BAT代码为何不能运行? [打印本页]

作者: jakorzhang    时间: 2012-10-17 11:41     标题: 窗口五颜六色的闪烁的BAT代码为何不能运行?

  1. @echo off
  2. :start
  3. for /l %%a in (0,1,7) do (
  4. for %%b in (8 9 a b c d e f) do (
  5.   for %%c in (08 19 2a 3b 4c 5d 6e 7f) do (
  6.    if not "%%a%%b"=="%%c" (
  7.    color %%a%%b&goto start
  8.    )
  9.   )
  10. )
  11. )
  12. pause
复制代码
我想实现的效果是窗口五颜六色的闪烁
可是为什么不行呢?
作者: apang    时间: 2012-10-17 13:26

程序运行了,但循环到颜色09时就跳出循环了,看不到颜色变化
将goto start移出for循环即可
  1. @echo off
  2. :start
  3. for /l %%a in (0 1 7) do (
  4.   for %%b in (8 9 a b c d e f) do (
  5.     for %%c in (08 19 2a 3b 4c 5d 6e 7f) do (
  6.       if not "%%a%%b"=="%%c" (
  7.         color %%a%%b
  8.         Rem for /l %%d in (1 1 10) do cd.>nul
  9. ))))
  10. goto :start
复制代码

作者: jakorzhang    时间: 2012-10-17 14:25

回复 2# apang
谢谢 明白了!




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