Possible Duplicate:
How to change the text color of comments line in a batch file
Hello I would like to print a message similar to : Test [OK] in green when a command works and Test [Failed] in red when a command fails
I found i could manage the DOS color by typing COLOR 0A for Black + Green and 0C for Black + Red and 07 for black and white.
Ex:
IF EXIST filename. (
COLOR 07
ECHO Test.
COLOR 0A
ECHO [OK]
) ELSE (
COLOR 07
ECHO Test.
COLOR 0C
ECHO [Failed]
)
REM: Setting the color back to default
COLOR 07
However when it reaches the line COLOR lines, it will just change the entire cmd screen in that color... Is there a way to print single strings in a different color.