How to change the line display color with the echo batch command?
My target is having a .cmd file with echo commands where I can setup for each
echo command the display and the background colors I would like (red, blue,
green...).
Under Windows XP (SP3) it is not possible to use the ANSI.SYS neither the
ANSI.COM.
For faster process, I want to use the Windows environment and do not come
back to the original DOS environment.
Then, I would like to know how I can change the line display color with the
echo batch command under Windows XP.
I am confident it is still possible. How remains the big question :-)
Best regards and thanks for the help.
Re: How to change the line display color with the echo batch command?
Presumably you speak about the Command Prompt under WinXP,
not DOS. DOS is a legacy operating system introduced some 30
years ago. It does not exist under WinXP.
If you wish to change the foreground/background colors of a
console session the color.exe is probably your command. Type
color.exe /? at the Command Prompt to see its syntax.
Re: How to change the line display color with the echo batch comma
Many thanks for your reply. However, it is not exactly the behaviour I would
like.
I am not interested in changing the foreground/background colors but only
individual lines within the Command Prompt box.
The purpose is having display text from my .cmd file with the textcolor I am
interested in. As example, I would like having the first line in green text,
the second one in red text, the thrid one in blue text, the forth one in
green text, the fifth one in blue text.
So, I must be ableI to define for each echo command the
foreground/background colors.
Re: How to change the line display color with the echo batch command?
u can change. try the following:
@echo off
chgcolor 07
echoj "How are "
chgcolor 4f
echoj "you"
chgcolor 07
echoj " today?"
If you run the above batch file, you'll see a single line of output that asks "How are you today?. The word "you" is emphasized in bright white text on a red background.
Re: How to change the line display color with the echo batch command?
you may also try out COLOR 4f instead of chgcolor 04