How Can One change the MS-DOS prompt font color?

You can use debug to write a short COM file. When you run debug you'll get a single dash prompt, enter the following (including blank lines) and you'll get a file color.com in your current working directory:

a 100
mov ah, 06
xor al, al
xor cx, cx
mov dx, 184f
mov bh, 07
int 10
mov ah, 4c
xor al, al
int 21

rcx
e
ncolor.com
w
q

It calls int 10 ah=06 to clear the screen, setting the cursor at the bottom and filling with attributes in bh. High nibble is background, low is foreground, colors are:

  • 0 = black
  • 1 = blue
  • 2 = green
  • 3 = cyan
  • 4 = red
  • 5 = purple
  • 6 = yellow
  • 7 = white
  • 8 = light black
  • 9 = light blue
  • A = light green
  • B = light cyan
  • C = light red
  • D = light purple
  • E = light yellow
  • F = light white

(Thus bit 4 is high intensity.) To get red background with black foreground change 07 to 40.

Parsing the command line args to set colors is non-trivial, so just hard code your favorite one. Or do this in debug to update it:

debug color.com
e 10a
40
w
q

Attribute is stored in location 010A, updating it directly is easier than typing it all again.


This cannot be done without Qbasic. We will run a small program that will modify the screen colors for the command prompt.

The screen qbasic command will be of much use.

Run this QBASIc program:

 SCREEN 0
 COLOR 26

Note: you can only have digits from 0-7