ARCHIVED: In DOS, how can I modify my prompt or the screen color?
Note: The software discussed here is no longer in common use at IU, and UITS may no longer be able to verify this text's accuracy; additionally, the UITS Support Center may no longer have the materials needed to adequately support this software.
You can use the prompt command to personalize the DOS prompt. The
format of the command is:
text is a line of text that specifies the format of
Changing Prompt Information
Place the following special codes in the text string to produce special information or characters:
|$e||ASCII escape code (code 27)|
|$g||> (greater-than sign)|
|$l||< (less-than sign)|
|$p||Current drive and path|
|$q||= (equal sign)|
|$v||DOS version number|
For example, a typical use of the
prompt command is:
This produces a prompt that consists of the current drive and path
followed by a greater-than sign. Once you have found a prompt that
you like, you should include the
prompt command that
produces it as an entry in your
located in the root directory.
If you wish to produce text of different colors, you will need to
install the ANSI screen driver. Make sure that the file
ANSI.SYS exists on your hard drive and is correctly
referenced in an entry in your
CONFIG.SYS file, similar
to the following:
DEVICE = C:\DOS\ANSI.SYS
The above example assumes that the
ANSI.SYS file is
located in your
DOS directory on the
C: drive. Replace the drive letter and/or
path information as necessary on your own computer.
ANSI.SYS replacements such as
FCONSOLE.DEV may also work, but
may be incompatible with some software.
You can change the colors of the text in the DOS prompt (and the color
attributes of the screen) using the following
xx = attribute code,
yy = foreground
color code, and
zz = background color code.
A table of the color codes follows:
|0||Turn Off Attributes|
|4||Underline (mono only)|
For example, the following command will result in a bright red
C:\> prompt and bright yellow text on a blue
Including color specifications in the prompt command changes not only the color of the prompt, but also the color of other text that you type or display. In the above example, the prompt will appear red, but other text will show up as yellow on blue.
For some interesting prompts, cut and paste as entries in your
AUTOEXEC.BAT file one of the following command lines that
begin with the prompt command:
GO IU!:prompt $e[5;37GOm$e[5;31mIU$e[0;33m$p$g
Merry Christmas:prompt $e[1;5;37m *$_$e[0;32;40m 1$_ $e[1;31;42m u $_$e[33;42m x o $e[30;40m$e[K$_ _$_$e[31m MERRY$_CHRISTMAS!$_$e[37m$p$g
Jack o' Lantern:prompt $e[1;32;40m Z$_$e[33;43m $e[40m$e[K$_$e[43m $_ __ $e[37;40m$e[37;40m$e[K$_ BOO!$_$_$e[35m $p$g$e[37m
Choo choo train:prompt $e[44;37;5m$e[16C$e[0;44;1;31m$_111$e[36m111$e[31m111$e[3 5m11 1\]$_$e[32;5mx x x x x x x$e[0;1;44;37m$e[1A$p$g
Last modified on October 25, 2010.