How to echo with different colors in the Windows command line

前端 未结 23 1237
野性不改
野性不改 2020-11-22 08:55

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.

23条回答
  •  长情又很酷
    2020-11-22 09:32

    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

提交回复
热议问题