Skip to contentSkip to conversation

How print output into diffent color

DISCUSSION Dos_Neo 3 participants 5 messages Nov 24, 2008 – Dec 9, 2008

lore
Share & tools
lore

Dos_Neo

author
#0 lore raw

Hi All,

I executing one batch file in dos prompt.So my problem is that if it give correct answer than it particalur line should print in green other wise in red color.

Is there any command though which i can do it.
i.e
fc /B output.txt output1.txt >null
if errorlevel 1 echo.////Bad///////(print in Red color)
if not errorlevel 1 echo.///Good///(print in Green color only particular line)

Signature · 2 lines
View this message in context: http://www.nabble.com/How-print-output-into--diffent-color-tp20655741p20655741.html
Sent from the linux-msdos mailing list archive at Nabble.com.
#1 lore raw
Quoted 10 lines · On Sun, 23 Nov 2008 22:51:25 -0800 (PST) Dos_Neo <[email protected]> wrote:

I executing one batch file in dos prompt.So my problem is that if it give correct answer than it particalur line should print in green other wise in red color.

Is there any command though which i can do it.
i.e
fc /B output.txt output1.txt >null
if errorlevel 1 echo.////Bad///////(print in Red color)
if not errorlevel 1 echo.///Good///(print in Green color only particular line)

http://www.robvanderwoude.com/ansi.html

Signature · 2 lines
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
#2 lore raw
In reply to Dos_Neo
Quoted 5 lines · On Tue, 9 Dec 2008 08:29:25 -0800 (PST) Dos_Neo wrote:

I executing one batch file in dos prompt.So my problem is that if it give correct answer than it particalur line should print in green other wise in red color.

Is there any command though which i can do it.

http://www.robvanderwoude.com/ansi.html

Signature · 2 lines
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
#3 lore raw
Quoted 10 lines · Frank Cox
Quoted 5 lines · On Tue, 9 Dec 2008 08:29:25 -0800 (PST) Dos_Neo wrote:

I executing one batch file in dos prompt.So my problem is that if it give correct answer than it particalur line should print in green other wise in red color.

Is there any command though which i can do it.

http://www.robvanderwoude.com/ansi.html

Good info, but that site wants to set cookies, so beware.

Mike

Signature · 5 lines
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!
#4 lore raw
Quoted 3 lines · On Tue, 09 Dec 2008 12:28:50 -0600 Mike McCarty wrote:
Quoted 1 line

http://www.robvanderwoude.com/ansi.html

Good info, but that site wants to set cookies, so beware.

That is (or at least, was) one of the first hits on Google when searching this subject, which is why I posted it here. There are, of course, a ton of other sites that contain much the same information.

I never noticed the cookie issue. Doesn't everyone surf with cookies turned off unless explicitly allowed?

Signature · 2 lines
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com