How to change colors of console window?

Cousin Stanley CousinStanley at HotMail.com
Sat Jan 11 09:06:52 EST 2003


|| Can you give an example of using an escape sequence
|| to change the DOS windows to, say blue on white ?

Bill ...

According to the documentation I've found,
the following ANSI Escape Sequence  SHOULD  produce
blue foreground / white background  from a BAT file ...

echo ;

However, on my Win98 system it comes out
blue on silver ...

I also can't seem to produce a  yellow  background
and the  blink  sequence doesn't blink on my machine ...

Following is a BAT file with a few more examples ...

Cousin Stanley

-----------------------------------------------------

:: aColors.bat

@echo off
cls
echo.

echo  %0.bat
echo.
echo  Ansi.Sys Foreground Colors
echo.

echo     0 :  Light on Dark   { Default }
echo     7 :  Dark  on Light  { Inverse }  
echo  30 :  Black
echo  31 :  Red
echo  32 :  Green
echo  33 :  Yellow
echo  34 :  Blue
echo  35 :  Magenta
echo  36 :  Cyan
echo  37 :  White

echo 

echo.
echo  Ansi.Sys Background Colors
echo.

echo  40 :  Black         
echo  41 :  Red           
echo  42 :  Green         
echo  43 :  Yellow ???    
echo  44 :  Blue          
echo  45 :  Magenta       
echo  46 :  Cyan          
echo  47 :  Light         
echo   7 :  Dark on Light 
echo 

echo.
echo  Blink This

echo.
echo  Ansi Escape Sequence

echo 






More information about the Python-list mailing list