Color command in Windows

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

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

For an example of how to use this command, please see the Example below.

Syntax

 color [[ ]] 

Parameters

ParametersDescription Specifies the background color. Specify foreground color. /? Show help at the command prompt.

Note

The following table lists valid hexadecimal digits that you can use as values ​​for B and F.

Value Color 0 Black 1 Blue 2 Green 3 Mint Green 4 Red 5 Purple 6 Yellow 7 White 8 Gray 9 Light Blue A Light Green B Light mint Green C Light red D Light purple E Light yellow F Bright white
  1. Do not use space characters between B and F.
  2. If you specify a hexadecimal digit, the corresponding color will be used as the foreground color and the background color is set to the default color.
  3. To set the default Command Prompt color window, click on the upper left corner of the Command Prompt window, click Defaults , click the Colors tab , then select the colors you want to use for Screen Text and Screen Background .
  4. If B and F are the same, the color command sets ERRORLEVEL to 1 and no changes are made to the background color or foreground color.

For example

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

 color 84 

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

 color e 

Note:

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

See more:

  1. Cmdkey command in Windows
  2. Clip command in Windows
  3. The chkntfs command in Windows
Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile