[Master Answer Logo]
Question

How to change the background color of dos prompt?

Answer

From the MS-DOS prompt command, the escape character can be specified as $e, e.g. prompt $e[44m;... would specify a blue background as part of the prompt. In C, C++, Java, Python or Perl this is "\x1B" (Perl also offers the mnemonically superior equivalent "\e"), in QBasic or GWBASIC, the code would be CHR$(27) or CHR$(&H1B) (for those of you who prefer hexadecimal).

— Source: Wikipedia (www.wikipedia.org)