# How to colorize text in windows console?

**URL:** <https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306>\
**Category:** Ruby\
**Created:** [July 13, 2007, 9:56am UTC](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306 "2007-07-13T09:56:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirtyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Post date:** [July 13, 2007, 9:56am UTC](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306/1 "2007-07-13T09:56:51Z")

</div>

Hi,  
Is any way to highlight text in windows cmd? I have a script which  
throws its output on cmd and it would be convenient to me if the text  
will be colorized.

---

<div class="post-metadata">

**Author:** ![sirtyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Post date:** [July 13, 2007, 10:09am UTC](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306/2 "2007-07-13T10:09:29Z")

</div>

2007/7/13, Marcin T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hi,  
> Is any way to highlight text in windows cmd? I have a script which  
> throws its output on cmd and it would be convenient to me if the text  
> will be colorized.

[http://www.google.com/search?q=ansi+color+codes](http://www.google.com/search?q=ansi+color+codes)

There might even be a gem or a project in the [http://raa.ruby-lang.org/](http://raa.ruby-lang.org/)

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![sirtyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Post date:** [July 13, 2007, 1:10pm UTC](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306/3 "2007-07-13T13:10:11Z")

</div>

> 2007/7/13, Marcin T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > Hi,  
> > Is any way to highlight text in windows cmd? I have a script which  
> > throws its output on cmd and it would be convenient to me if the text  
> > will be colorized.

Two real choices:

[http://rubyforge.org/projects/win32console/](http://rubyforge.org/projects/win32console/)

or

[http://www.jpsoft.com/4ntdes.htm](http://www.jpsoft.com/4ntdes.htm)

Both of which will fix the problem (from two completely different  
directions).

Good luck  
pth

---

<div class="post-metadata">

**Author:** ![sirtyman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@sirtyman](https://www.ruby-forum.com/u/sirtyman)\
**Post date:** [July 13, 2007, 4:37pm UTC](https://www.ruby-forum.com/t/how-to-colorize-text-in-windows-console/109306/4 "2007-07-13T16:37:46Z")

</div>

On Jul 13, 2007, at 3:07 AM, Robert K. wrote:

> 2007/7/13, Marcin T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > Hi,  
> > Is any way to highlight text in windows cmd? I have a script which  
> > throws its output on cmd and it would be convenient to me if the text  
> > will be colorized.
> 
> [ansi color codes - Google Search](http://www.google.com/search?q=ansi+color+codes)
> 
> There might even be a gem or a project in the http://raa.ruby-  
> [lang.org/](http://lang.org/)

HighLine can do it:

[http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/trunk/](http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/trunk/)  
highline/examples/ansi\_colors.rb?revision=116&root=highline&view=markup

James Edward G. II
