Word coloring in BATCH

greg1107 Posted messages 71 Status Member -  
julescrepi Posted messages 1 Status Member -
Hello everyone,

Thank you for reading me already, it makes me happy!

I would like some help to colorize certain parts of my sentences, titles, subtitles, words (...) in my batch; to make them more beautiful and therefore more attractive, there's nothing like colorizing to structure your command prompt executed with your batch script.

Thank you for shedding your light on me, but in color please

Best regards to you CCM users :)

greg1107

2 answers

  1. karirovax Posted messages 3584 Status Member 215
     
    Hello

    Are you talking about batch (Ms-Dos) or bash (Linux shell)?

    If it's about batch, use the help in the command prompt by typing:

    COLOR /?
    Example:
    color 1e
    The 1 for the background and the e for the text

    1: dark blue
    e: light green

    ;)
    0
    1. greg1107 Posted messages 71 Status Member 2
       
      Hello,
      thank you for getting back to me!
      What you’re telling me, I understand: a background color and a font of my choice.
      What I would really like is to have a background color and several different colored fonts in the same window.

      title 1: blue
      title 2: red
      subtitles: green for example.

      For now, I'm working in batch on Windows

      A big thank you, internet friend and CCM users Forum
      0
    2. karirovax Posted messages 3584 Status Member 215
       
      Re, hi

      For the Windows batch (DOS), it’s impossible according to my knowledge!!

      Because the only command under DOS is the COLOR command which colors the background (the entire window) and the text (in the whole window),

      it’s possible to do this using a programming language like C/C++, Fortran, Pascal, ...etc
      ;)
      0
  2. julescrepi Posted messages 1 Status Member
     
    Sorry for the dig, but I might have the solution!
    Here is a batch (BatchCraft) with different colored characters! If you manage to "dissect" it, you might find out how! (It's up to you to continue!)
    0