4

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

MS-DOS is really old, and being the grandpappy of the computers it is really hard to find support for it.

I have these tried suggestions from websites:
http://www.easydos.com/menucolor.html
https://support.microsoft.com/en-us/kb/95099
http://www.computerhope.com/color.htm

I have edited: Config.sys (It now says 'Menucolor= 2,0' ) C:\Windows\color.txt (It now says 'green')

Still not working.
Anyone have any idead on how to do this?

Notes

Before you suggest 'color a', Ms-Dos is not the cmd. I already tried that.
It is possible! There are multiple ms-dos viruses that have done this effectively.
I am running MS-DOS from Windows 98 on a virtual machine.

user
  • 29,449
  • 11
  • 99
  • 144
Roke
  • 1,012
  • 1
  • 11
  • 31
  • "I am running MS-DOS 6.22 on a virtual machine." ... I know this won't answer your question but... why? – danicotra Jul 20 '15 at 21:27
  • 1
    Whoops... I meant I am running MS-DOS from Windows 98 on a virtual machine! – Roke Jul 20 '15 at 21:55
  • 1
    I just like looking at and playing with MS-DOS. It is old and pretty cool. I'm sorry I can't fully explain. :P – Roke Jul 20 '15 at 21:56
  • If my memory serves me right one way to do this was via a crazy little assembler included in DOS, I cannot remember it’s name. The assembler was accessing the BIOS routines included in the ROM - which is not part of any virtualization I know of today. Dr. Dobb’s had these few lines of tricks in hordes, but again - you most likely need real hardware with the BIOS routines on the ROM IC to make it work. You could search the archives of Dr. Dobb’s for them. – arch-abit Jul 21 '15 at 00:00
  • 1
    @RookieTEC9 : you must be a vintage/nostalgia lover... ;-) – danicotra Jul 21 '15 at 06:19
  • @RookieTEC9 That assembler was called 'debug', a standalone program not part of msdos.sys, and it is still pretty well documented on the web. Good luck! – arch-abit Jul 21 '15 at 22:01
  • @arch-abit Virtualization software needs to provide the BIOS routines and compatible in-VM memory mappings for things to work at all. If they didn't, it is highly unlikely that Windows 98 would start at all. – user Oct 23 '15 at 09:18
  • Michael - debug.com is an assembler for MS-DOS. It was probably created to try and BYPASS the ever-evil BIOS. Back in those days... Virtualization is NOT to reproduce things far passed, but to show us things yet to come! – arch-abit Oct 25 '15 at 03:24
  • I'm on it, should have an answer soon. – Roke Nov 01 '15 at 19:56

3 Answers3

4

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.

rat
  • 183
  • 6
2

If you load ANSI.SYS then define the DOS prompt (for example):

c:>prompt $e[1;33m$p$g

you can change the prompt color and the prompt itself.

Changes the cmd.exe command prompt.

PROMPT [text]

  text    Specifies a new command prompt.

Prompt can be made up of normal characters and the following special codes:

  $A   & (Ampersand)
  $B   | (pipe)
  $C   ( (Left parenthesis)
  $D   Current date
  $E   Escape code (ASCII code 27)
  $F   ) (Right parenthesis)
  $G   > (greater-than sign)
  $H   Backspace (erases previous character)
  $L   < (less-than sign)
  $N   Current drive
  $P   Current drive and path
  $Q   = (equal sign)
  $S     (space)
  $T   Current time
  $V   Windows version number
  $_   Carriage return and linefeed
  $$   $ (dollar sign)
eoredson
  • 131
  • 5
2

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

Roke
  • 1,012
  • 1
  • 11
  • 31