Colour in command prompt boxes

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.
 
F

foxidrive

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 /?
 
D

dan4793

Thanks, but that changes the entire window's colours. I want to change
only one word or one line in that window.
 
T

Timo Salmi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top