China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-14 06:31
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » How to Change the DOS Background Color View 2,113 Replies 11
Original Poster Posted 2003-12-02 00:00 ·  中国 吉林 长春 联通
中级用户
★★
Credits 420
Posts 86
Joined 2003-06-03 00:00
23-year member
UID 3187
Gender Male
Status Offline
Moderator:
Hello, I'd like to ask how to change the DOS background color. Black background with white text all the time is too monotonous. Please help.
Thanks
Floor 2 Posted 2003-12-02 00:00 ·  中国 山东 德州 联通
初级用户
Credits 114
Posts 3
Joined 2003-11-28 00:00
22-year member
UID 13496
Gender Male
Status Offline
I want to know too
Floor 3 Posted 2003-12-03 00:00 ·  中国 广东 广州 白云区 电信
初级用户
★★★
Credits 1,480
Posts 377
Joined 2003-06-06 00:00
23-year member
UID 3875
Gender Male
Status Offline
There is a line in config.sys: menucolor=7,0. Just change those two numbers.
欢迎大家访问我的主页!
精品.爱好http://iso.533.net
Floor 4 Posted 2003-12-05 00:00 ·  中国 北京 朝阳区 联通
初级用户
Credits 236
Posts 28
Joined 2003-11-13 00:00
22-year member
UID 12760
Gender Male
Status Offline
Sets the default foreground and background colors of the console.

COLOR

attr Specifies the color attribute of the console output

Color attributes are specified by two hexadecimal digits -- the first is the background, and the second is the
foreground. Each digit can be any one of the following values:

0 = black 8 = gray
1 = blue 9 = light blue
2 = green A = light green
3 = cyan B = light cyan
4 = red C = light red
5 = purple D = light purple
6 = yellow E = light yellow
7 = white F = bright white

If no argument is given, this command restores the color to the one in effect when CMD.EXE
was started. This value comes from the current console window, the /T switch, or
the DefaultColor registry value.

If the COLOR command is executed with the same foreground and background color, the COLOR command
will set ERRORLEVEL to 1.

For example: "COLOR fc" produces light red on bright white
Floor 5 Posted 2003-12-05 00:00 ·  中国 广西 玉林 联通
初级用户
Credits 163
Posts 19
Joined 2003-03-19 00:00
23-year member
UID 1191
Gender Male
Status Offline
Where do I set this console command?

I'm a newbie, please give me some pointers!
Floor 6 Posted 2003-12-06 00:00 ·  中国 北京 科技网
银牌会员
★★★
颓废青年
Credits 2,265
Posts 721
Joined 2003-05-12 00:00
23-year member
UID 2032
Gender Male
Status Offline
Dianji already explained it very clearly.
Floor 7 Posted 2003-12-06 00:00 ·  中国 吉林 长春 联通
中级用户
★★
Credits 420
Posts 86
Joined 2003-06-03 00:00
23-year member
UID 3187
Gender Male
Status Offline
Everyone:
What I mean is in pure DOS, a blue-background, white-text screen environment, not in CMD or in a menu item.
Floor 8 Posted 2004-12-16 00:00 ·  中国 吉林 长春 中移铁通
初级用户
Credits 175
Posts 23
Joined 2003-11-15 00:00
22-year member
UID 12832
Gender Male
Status Offline
I want to know too, bump!
Floor 9 Posted 2004-12-18 00:00 ·  中国 江苏 盐城 射阳县 电信
初级用户
Credits 65
Posts 6
Joined 2004-12-18 00:00
21-year member
UID 34737
Gender Male
Status Offline
Too deep, I can't understand it. I need to work hard
Floor 10 Posted 2004-12-18 00:00 ·  中国 上海 教育网
初级用户
Credits 107
Posts 2
Joined 2004-12-04 00:00
21-year member
UID 34329
Gender Male
Status Offline
There is one way,
load ansi.sys in config.sys,
then use ansi escape sequence in the prompt to change the foreground and background colors.
For example, add this in autoexec.bat:
prompt $E

Floor 11 Posted 2005-03-24 00:00 ·  中国 广东 深圳 罗湖区 电信
中级用户
★★
Credits 271
Posts 74
Joined 2004-11-17 00:00
21-year member
UID 33721
Gender Male
Status Offline
Right, can this be done by modifying DOS system files?
Floor 12 Posted 2005-03-25 00:00 ·  中国 江苏 苏州 电信
初级用户
Credits 134
Posts 12
Joined 2005-03-25 00:00
21-year member
UID 37420
Gender Female
Status Offline
Look at the notes, use color attr 07
To change the color, use color 70 etc. (70 is the color code)
Forum Jump: