Professional Documents
Culture Documents
Note: The software discussed here is no longer in common use at IU, and UITS (ahaw) 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:
prompt text
where text is a line of text that specifies the format of the prompt.
Code Result
$_ Enter/Linefeed
$$ Dollar sign
$b | (pipe)
$d Current date
$h Backspace
$n Current drive
$q = (equal sign)
$t Current time
Code Result
$_contentEnter/Linefeed
Skip to
Skip to
$$search Dollar sign
Skip to login
https://kb.iu.edu/d/aamm 1/5
15/12/2022, 13:37 In DOS, how can I modify my prompt or the screen color?
Code Result
$b | (pipe)
$d Current date
$h Backspace
$n Current drive
$q = (equal sign)
$t Current time
prompt $p$g
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
AUTOEXEC.BAT file, located in the root directory.
Changing Colors
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.
Note: ANSI.SYS replacements such as NANSI.SYS or 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
escape sequence:
$e[xx;yy;zzm
where xx = attribute code, yy = foreground color code, and zz = background color code.
Code Color
Skip to content
0 Turn Off Attributes
Skip to search
1 High Intensity
Skip to login
https://kb.iu.edu/d/aamm 2/5
15/12/2022, 13:37 In DOS, how can I modify my prompt or the screen color?
Code Color
2 Normal Intensity
5 Blink
7 Reverse Video
8 Invisible
30 Black
31 Red
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
40 Black
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White
Code Color
1 High Intensity
2 Normal Intensity
5 Blink
7 Reverse Video
8 Invisible
30
Skip to content Black
Skip to search
31 Red
Skip to login
https://kb.iu.edu/d/aamm 3/5
15/12/2022, 13:37 In DOS, how can I modify my prompt or the screen color?
Code Color
32 Green
33 Yellow
34 Blue
35 Magenta
36 Cyan
37 White
40 Black
41 Red
42 Green
43 Yellow
44 Blue
45 Magenta
46 Cyan
47 White
For example, the following command will result in a bright red C:\> prompt and bright yellow text on a blue
background.
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.
Sample Prompts
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
Skip to search
Skip to login
https://kb.iu.edu/d/aamm 4/5
15/12/2022, 13:37 In DOS, how can I modify my prompt or the screen color?
Navigation
Home (/)
Menus (/d/menu)
About us (/d/line)
IT@IU
About IT (http://it.iu.edu/about/)
IT staff (https://uits.iu.edu/staff)
Jobs in IT (http://it.iu.edu/jobs/)
OVPIT (http://it.iu.edu/ovpit/)
Accessibility (https://accessibility.iu.edu/assistance/)
Privacy (/d/priv)
https://kb.iu.edu/d/aamm 5/5