Changes the foreground and background colors in the Command Prompt window for the current session. If used without parameters, color restores the default Command Prompt window foreground and background colors.


color [[<b>]<f>]


Parameter Description
<b> Specifies the background color.
<f> Specifies the foreground color.
/? Displays help at the command prompt.


The following table lists valid hexadecimal digits that you can use as the values for <b> and <f>:

Value Color
0 Black
1 Blue
2 Green
3 Aqua
4 Red
5 Purple
6 Yellow
7 White
8 Gray
9 Light blue
a Light green
b Light aqua
c Light red
d Light purple
e Light yellow
f Bright white


  • Don't use space characters between <b> and <f>.

  • If you specify only one hexadecimal digit, the corresponding color is used as the foreground color and the background color is set to the default color.

  • To set the default Command Prompt window color, select the upper-left corner of the Command Prompt window, select Defaults, select the Colors tab, and then select the colors that you want to use for the Screen Text and Screen Background.

  • If <b> and <f> are the same color value, the ERRORLEVEL is set to 1, and no change is made to either the foreground or the background color.


To change the Command Prompt window background color to gray and the foreground color to red, type:

color 84

To change the Command Prompt window foreground color to light yellow, type:

color e


In this example, the background is set to the default color because only one hexadecimal digit is specified.

Additional References