Delen via


Color

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

Syntax

color [fb]

Parameters

fb   : Sets the foreground f and background g colors. The following tables lists valid hexadecimal digits that you can use as the values for f and g.

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

/?   : Displays help at the command prompt.

Remarks

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

  • You can use **cmd /t:**fb to change the Command Prompt window colors for the current session.

  • If the foreground and background colors are the same, the color command sets ERRORLEVEL to one (1).

Examples

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

color FC

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Command-line reference A-Z

Cmd