中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-10 15:59
47,811 topics / 349,897 posts / today 0 new / 48,255 members
DOS批处理 & 脚本技术(批处理室) » Cycle through changing the background color and text color of the cmd window one by one
Printable Version  4,708 / 4
Floor1 gskys123 Posted 2007-01-15 12:02
初级用户 Posts 7 Credits 26 From 四川
I want to make the background color and text color of the cmd window change in a cycle one by one (I want to choose a good effect configuration from it). How to write it with for?
After each color change, choose whether to continue the experiment and output the background and text color codes of the current window:
The current background and text color, for example, output 0a
%a% %b% respectively store
Background color and text color, that is like this: select two combinations from 0, 1, 2, 3...9, a, b, c, d, e, f one by one and give them to a, b respectively until all combinations are selected, then use
color %a%%b%
to for loop to choose whether to continue the experiment and display the current configuration

[ Last edited by gskys123 on 2007-1-15 at 12:03 PM ]
Floor2 namejm Posted 2007-01-15 12:23
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Version 1:

Version 2:


[ Last edited by namejm on 2007-1-15 at 12:23 AM ]
Floor3 iaide Posted 2007-01-15 12:43
初级用户 Posts 20 Credits 49
Test the code of namejm, and find: no color such as :10 12 13 14
Floor4 namejm Posted 2007-01-15 12:48
荣誉版主 Posts 1,737 Credits 5,226 From 成都
At that time, I only thought about the situation where numbers come before letters and ignored other situations, making a low-level mistake. Sweat. The second floor has been updated.
Floor5 gskys123 Posted 2007-01-17 01:23
初级用户 Posts 7 Credits 26 From 四川
Thanks namejm!! ;)
This way, my understanding of the usage of for has deepened a bit!
Thank you!!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023