views:

145

answers:

3

I know that the color bf command sets the colors of the whole command line window but I wanted to to print one single line in a different color.

Thanks

+1  A: 

You'll need to echo an ANSI escape code sequence to alter the text colour: http://en.wikipedia.org/wiki/ANSI_escape_code

Another very good source of these escape codes is http://ascii-table.com/ansi-escape-sequences.php

Bernhard Hofmann
That looks really promising but how do I emit the Escape character - ASCII 27 in an echo command?
ruibm
The Windows console is *no* Terminal emulator. ANSI escape sequences simply can't work. You could coax Windows 9x into doing so by loading ANSI.SYS but we're a little past that by now.
Joey
+1  A: 

We used to do this with ANSI terminal codes. Not sure if they still work, but you could try them.

Michael J
+1  A: 

you could use cecho.. you can also use it to embed right into your script so you dont have to carry along a .com or .exe

http://www.codeproject.com/KB/recipes/BatchFileColors.aspx

Brian Gleason