You are not logged in.

#1 03 Jun 2007 17:52

Fen_Li
Member
From: Malang, Indonesia
Registered: 04 May 2007
Posts: 22
Website

Colored message...

How to display colored message using echo command (or something else) ?
but, without using resource kit or utility tools..
ex:
i want to display "Hello I'am Red" in color=RED
                        "Hello I'am Blue" in color=Blue
I try this but doesn't work :

@echo off
color 04
echo "Hello I'am Red"
color 09
echo "Hello I'am Blue"
pause>nul

Result:
both of them in Blue..
sad

Last edited by Fen_Li (03 Jun 2007 20:11)


G-Smart thing Smart

Offline

#2 05 Jun 2007 08:54

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: Colored message...

Although it's not abundantly clear from it's help page, the "color" command addresses the entire screen only.

As far as I know there's no native way to change colours in a more precise manner.


cmd | *sh | ruby | chef

Offline

#3 06 Jun 2007 19:21

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Colored message...

I don't think you can do that in the cmd shell, however if you use the new PowerShell in Vista or Win XP (free download) then you can do it with Write-Host:

Write-Host -ForeGroundColor Yellow "some text in yellow " -nonewline
Write-Host -ForeGroundColor Red "some more text in red"

Offline

Board footer

Powered by