7 April 2016

How to Change Text & Background Color of Command Prompt

1 comment
Command Prompt can be used in number of ways. If you know that correct way to use it, you might also know that it is the soul of Windows operating system. But unfortunately, most of the people hate it because of its user interface and even I was one of them. In this era of high-definition graphics, its looks boring to work on small black box window and that too with B&W colors only. So what to do then?

Change Text & Background Colors of Command Prompt

At least Command Prompt allow us to change font and background colors. In this short tutorial, I will guide you how to change it. Well there are two different methods you can use. Actually both of them are same, the only difference is that, first method will permanently change colors while second method changes will last only for current session. Now lets start with first method.

1. Use CMD Properties


As like in case of folder and shortcut, Command Prompt also have properties option which can be used to customize basic settings like font size, color and window layout. Unlike in case of folder and shortcut, these properties options are hidden for Command Prompt. You can follow these steps to access them. I am using Windows 7 for this tutorial.
  1. First of all, open Command Prompt from start menu. (search it or use run command)
  2. Now right-click on program title section. (See below picture)

    Properties Option

  3. A hidden menu will open where you'll find "Properties" option. Simply click it and a new window will open.
  4. Now move to "Colors" tab.

    Color Tab
Under this tab, you'll find 4 options as screen text, screen background, popup text and popup background. Very few people know about Command Prompt popups. Good example is when you press "Fn+F7" keyboard shortcut key, a popup box appears which will show you the list of commands you've executed. Now select each option and choose color for it. You can also check the output in preview window. One of my favorite combination is light green text on black background.

Apart from this, you can also add RGB values. RGB stands for red, green and blue. These are the primary colors which can be used to create any other color combination. Each color has its own RBG values which is unique. Obviously, It wouldn't be possible to remember all of them. The easiest way to find these values of your favorite color is to use W3Schools Color Picker. This is an online tool or simply a webpage using which you can select any color and it will automatically display its RGB values.


W3Schools Color Picker

After this, paste these values in their respective color and click OK button to save changes. Now tell me how it looks?

Also Read: How to copy text from Windows Command Prompt


2. Use COLOR Command


There are tons of commands available for cmd.exe and one of them is "COLOR". This can be used to change the font and background color of Command Prompt window. As already mentioned, the only drawback of this method is that it will change the colors for current session only i.e., when you'll close and re-open the program again, same default colors will load. On the other hand, we have positive benefit of using this method. It can be used to change the color of batch program window which isn't possible directly from 1st method. The basic syntax for this command is -

COLOR [Specify color attributes]

Color attributes are specified by 2 hex digits. The first one corresponds to the background and second to the text. For example, "COLOR 0a". If you'll execute this code, your text will change to light green and background will remain same as black. Color values lie between 0 to 9 and A to F. You can create any combination. For example, "COLOR a1". To find more about this command, executing "COLOR /?" code. It will display a help section where you'll find all color values. Below is the screenshot of output.


Color Command Help

In this way, you can easily change these font and background colors in Command Prompt window. If you're facing any problem, please ask me comment box. Which method you've found easy? Is there any other way to do this?

1 comment:

  1. At my pc the first digit corresponds with foreground and the second digit with background (why?). When I want to change only foreground it works ok: Color 4 gives Red characters on whatever the background color is, but when I only want to change the color of the background, it does not work in a simmelary. You cannot leave out the first digit.

    ReplyDelete