Set Default Console Foreground & Background colors for command prompt


command-promptThis is a simple technique to change the foreground as well as background colors of your command prompt.

Syntax: color [attrib]

here attrib specifies the color attributes of console output.

The color attrib is specified by a 2 hex-digit code which first digit represents the background and second digit represents the  foreground color.

It will be bit boring if you have continued your work on the same platform. So let us make our work bit interesting while we are working on the command prompt for running out Java or Tasm/Masm programs by changing the foreground and background colors.

This is a simple technique. Lets us finally navigate to our process.

  1. Open your command prompt.
  2. Then type “color fc
  3. This will display the “text in red” with “bright white background.
  4. You can make use of lots of other combinations. Just type “help color“.
  5. You can select around 16 different attributes to set your color for the command prompt.
  6. Then arises a million dollar question, how to set it to default screen after doing this. Just type “color” and press “enter” it will restores the color to what it was when the “cmd.exe” was started or else it will appears same a before after closing and restarting the command prompt.