Colour in command prompt boxes

  • Thread starter Thread starter dan4793
  • Start date Start date
D

dan4793

Hi guys,

I was wondering if it's possible to have differently coloured text in a
command prompt Windows.

When using a batch file, or a Perl script printing to STDERR or STDOUT,
is it possible to print a single word's text in, for example, red and
the rest in the default colour (say green, for example) all in the same
line? Or is it possible to print an entire line in red text? Can
background colours also be changed? If it is possible, can someone post
how to do it?

I'm using Windows 2000 SP 4 and Windows XP SP 2.

Thanks in advance.
 
Hi guys,

I was wondering if it's possible to have differently coloured text in a
command prompt Windows.

When using a batch file, or a Perl script printing to STDERR or STDOUT,
is it possible to print a single word's text in, for example, red and
the rest in the default colour (say green, for example) all in the same
line? Or is it possible to print an entire line in red text? Can
background colours also be changed? If it is possible, can someone post
how to do it?

I'm using Windows 2000 SP 4 and Windows XP SP 2.

Thanks in advance.

Try this at the cmd line

color /?
 
Thanks, but that changes the entire window's colours. I want to change
only one word or one line in that window.
 
I was wondering if it's possible to have differently coloured text
in a command prompt Windows.

Yes, it is.

51} How can I echo lines in different colors in NT scripts?
163586 May 1 2006 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

All the best, Timo
 
Back
Top