How to Change Colours in Command Prompt in Windows?

Command Prompt is a neat command-line interpreter that comes in-built with the Windows operating system. Command prompt is still used for performing various functions such as, collecting information on the network state of the computer, troubleshooting the system, deleting files, formatting computers, etc.
Customizing the Command Prompt according to your needs may end up resulting in your productivity and if you are a young learner who started learning about Command Prompt recently, you will want to check this out! First, it’s important to know for reference how a default Command Prompt terminal looks like, it looks something like this:

How-cmd-looks

Here, we are going to change the color text and also the background color of cmd. Assume 2 variable x & y which are associated with specific colors.

color xy

x‘ represents the color of the Terminal’s background, whereas,
y‘ represents the color of the font on the Command Prompt Terminal.

Following the HEX values of the colors supported by Command Prompt:

    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

Example 1: Suppose we want a white background, so after referring to the color table above we will type, ‘f’ in place of ‘x’. Similarly, if we want a light purple colored font, we will type ‘d’ in place of ‘y’.
(x & y are the variables we had assumed earlier).



color fd

Changing-Background-and-Text-Color-in-cmd

Example 2: ‘0’ specifies the black color attribute, and since its typed at the place of ‘x’ i.e. it will be applied to background. ‘a’ specifies the light green color attribute, and since its typed at the place of ‘y’ i.e light green attribute will be applied to the font color.

color 0a

Changing-Background-and-Color-Text-in-cmd-1

Note: To get all the related information on using color command in Command Prompt you can use the following command

color /?

Getting-the-color-attributes-information-of-cmd

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.