标题: 窗口五颜六色的闪烁的BAT代码为何不能运行? [打印本页]
作者: jakorzhang 时间: 2012-10-17 11:41 标题: 窗口五颜六色的闪烁的BAT代码为何不能运行?
- @echo off
- :start
- for /l %%a in (0,1,7) do (
- for %%b in (8 9 a b c d e f) do (
- for %%c in (08 19 2a 3b 4c 5d 6e 7f) do (
- if not "%%a%%b"=="%%c" (
- color %%a%%b&goto start
- )
- )
- )
- )
- pause
复制代码
我想实现的效果是窗口五颜六色的闪烁
可是为什么不行呢?
作者: apang 时间: 2012-10-17 13:26
程序运行了,但循环到颜色09时就跳出循环了,看不到颜色变化
将goto start移出for循环即可- @echo off
- :start
- for /l %%a in (0 1 7) do (
- for %%b in (8 9 a b c d e f) do (
- for %%c in (08 19 2a 3b 4c 5d 6e 7f) do (
- if not "%%a%%b"=="%%c" (
- color %%a%%b
- Rem for /l %%d in (1 1 10) do cd.>nul
- ))))
- goto :start
复制代码
作者: jakorzhang 时间: 2012-10-17 14:25
回复 2# apang
谢谢 明白了!
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |