Skip navigation

JSI Tip 1266. Console color configurator.

Using Control Panel / Console / Colors, you can configure the console background and text colors.

NOTE: See tip 0336 for how this is stored in the registry.

You can also set the current (non-persistent) backround/text colors at a command prompt:

color BT

where B is the backgroung color and T is the text color, per the following table:

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

The default is 07, White text on a Black background. To rapidly cycle through all possible color combinations, so you can choose your defaults, run testcolor.bat, which contains:

@echo off
for /l %%i in (0,1,15) do call :cycle1 %%i
goto end
set /a cb=%1
if %cb% LSS 10 goto cycle11
if %cb% EQU 10 set cb=A&goto cycle11
if %cb% EQU 11 set cb=B&goto cycle11
if %cb% EQU 12 set cb=C&goto cycle11
if %cb% EQU 13 set cb=D&goto cycle11
if %cb% EQU 14 set cb=E&goto cycle11
set cb=F
for /l %%i in (0,1,15) do call :cycle2 %%i
goto end
set /a cf=%1
if %cf% LSS 10 goto cycle21
if %cf% EQU 10 set cf=A&goto cycle21
if %cf% EQU 11 set cf=B&goto cycle21
if %cf% EQU 12 set cf=C&goto cycle21
if %cf% EQU 13 set cf=D&goto cycle21
if %cf% EQU 14 set cf=E&goto cycle21
set cf=F
if %cb% EQU %cf% goto end
color %cb%%cf%
@echo color %cb%%cf%
REM You could use sleep 2 or Sleep 3 instead of pause

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.