Skip to main content

Coloured text in XP command window

More
18 years 4 months ago #15460 by TheBishop
Here's one for all you old timers!
Back in the days of real DOS you could use ANSI escape sequences to format command line text in different colours etc.
Does anyone know of a way to obtain coloured text in a command shell window under XP? Specifically I have a long perl script that checks the network health and it would be nice to have 'OK' come up in green but 'FAIL...' in red.
Any suggestions?
More
18 years 4 months ago #15461 by DaLight
It appears that cmd.exe (the command prompt under W2K/XP) does not support ANSI escape sequences as you've deduced. You can however get round this by using COMMAND.COM instead of cmd.exe. Check out this link .
More
18 years 4 months ago #15462 by TheBishop
Replied by TheBishop on topic command.com
Thanks for that.
I'll have to do some testing to see whether all the stuff in my script will still work in a 16-bit legacy environment...
Time to create page: 0.117 seconds