In DOS, how can I set the foreground color and background color?
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!
C:\>color /?
Sets the default console foreground and background colors.
COLOR
attr Specifies the color attributes of console output
The color attribute is specified by two hexadecimal digits -- the first
is the background, the second is the foreground. Each digit can be one
of the following values:
0 = black 8 = gray
1 = blue 9 = light blue
2 = green A = light green
3 = light green B = light aqua
4 = red C = light red
5 = purple D = light purple
6 = yellow E = light yellow
7 = white F = bright white
If no parameters are given, the command resets the color to what it was
when CMD.EXE started. This value is either from the current console
window, the /T command line switch, or the DefaultColor registry value.
If COLOR is invoked with the same foreground and background colors, the
ERRORLEVEL is set to 1.
For example: "COLOR fc" produces bright red on bright white