Windows Command-Line – How to Reset Colors in CMD

colorscommand linewindows

I often run commands in cmd.exe that have pretty colors in their output, which is great. Unfortunately, sometimes they die in the middle, or I have to kill them, and then the console window itself gets stuck in (say) red text on black background, which is awkward.

How do I reset the text color to the default?

On a unix terminal, I can type reset — I'm looking for the cmd.exe equivalent of that.

Best Answer

Color 07 will set it to the default scheme that cmd.exe uses.

Color attributes are specified by TWO hex digits -- the first corresponds to the background; the second the foreground. Each digit can be any of the following values:

0 = Black       8 = Gray
1 = Blue        9 = Light Blue
2 = Green       A = Light Green
3 = Aqua        B = Light Aqua
4 = Red         C = Light Red
5 = Purple      D = Light Purple
6 = Yellow      E = Light Yellow
7 = White       F = Bright White
Related Question