PC Review


Reply
Thread Tools Rate Thread

changing the color of a single line in a cmd window

 
 
Mombiatch
Guest
Posts: n/a
 
      18th Aug 2004
Hi

I'm trying to change a single line of output from a batch file to red (to
show there's an error). I tried 'color c' but this changed the entire
window's text :-P Anyone have any ideas? I used to work for Microsoft and
saw this plenty of times, but then again, it might have been
Console.Writeline in an exe rather than a batch file.

Thanks
Joe


 
Reply With Quote
 
 
 
 
Herbert Kleebauer
Guest
Posts: n/a
 
      18th Aug 2004
Mombiatch wrote:

> I'm trying to change a single line of output from a batch file to red (to
> show there's an error). I tried 'color c' but this changed the entire
> window's text :-P Anyone have any ideas? I used to work for Microsoft and
> saw this plenty of times, but then again, it might have been
> Console.Writeline in an exe rather than a batch file.


@echo off
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(L...2Dx=>ctext.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>ctext.com
echo pZsAZ~ZzOL@KtZ{O@}1guN?_g~K=G?U_Pg]NYG?w?KgBw}IqtH@wR?wABO>>ctext.com
echo LrFZp{@XEKH@lQNgw@ECuQtj{OM?DG@@_Aqo{Ox{R?kNv@ZjosB@IoXEFr>>ctext.com
echo @W@K~Xj~@XeK??BB0x>>ctext.com

cls
echo 1. echo line

ctext 10 20 9 This is a light blue/black text at pos 10,20
ctext 11 20 2 This is a green/black text at pos 11,20
ctext 12 20 4 This is a red/black text at pos 12,20
ctext 13 20 12 This is a light red/black text at pos 13,20

echo 2. echo line

ctext +15 20 160 This is a black/light green text at pos 15,20

echo 3. echo line

del ctext.com

:: usage: ctext line column color text
:: write text with color "color" to screen at pos (line,column)
:: use a + before column to update cursor position
 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      18th Aug 2004
"Mombiatch" wrote:

>Hi
>
>I'm trying to change a single line of output from a batch file to red (to
>show there's an error). I tried 'color c' but this changed the entire
>window's text :-P Anyone have any ideas? I used to work for Microsoft and
>saw this plenty of times, but then again, it might have been
>Console.Writeline in an exe rather than a batch file.
>
>Thanks
>Joe
>

Wbat from Horst Schaeffer
http://home.mnet-online.de/horst.muc/

or the conutils from Frank P.Westlake
Tools hosted by Ted Davis at http://gearbox.maem.umr.edu/fwu/

Colorx in the Batch Script Tools from Bill Stewart can do this
http://mywebpages.comcast.net/stewartb/bst.html

The last one IMO easiest to use:

@echo off
colorx -l
colorx -c C0
echo this line in black on red background
colorx -c 1e
echo this is my favorite yellow on blue

HTH
--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
Reply With Quote
 
Matthias Tacke
Guest
Posts: n/a
 
      18th Aug 2004
Herbert Kleebauer wrote:

>Mombiatch wrote:
>
>> I'm trying to change a single line of output from a batch file to red (to
>> show there's an error). I tried 'color c' but this changed the entire
>> window's text :-P Anyone have any ideas? I used to work for Microsoft and
>> saw this plenty of times, but then again, it might have been
>> Console.Writeline in an exe rather than a batch file.

>
>@echo off
>echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(L...2Dx=>ctext.com

<snip>

works fine Herbert,
but due to the fact it's a com program doesn't know of other than
standard screen sizes (80*25,80*43,80*50) and flickers annoyingly.

--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing a line color when it crosses another benchmark line? =?Utf-8?B?SkIxMg==?= Microsoft Excel Charting 3 10th Dec 2005 04:48 PM
changing the color of a single bar on a graph =?Utf-8?B?QnJpYW4=?= Microsoft Excel Charting 1 22nd Nov 2005 04:55 PM
Changing color with in a single label?? Bob Achgill Microsoft VB .NET 6 11th May 2004 09:28 PM
changing the background color on a single column Microsoft Excel Worksheet Functions 2 30th Jan 2004 10:32 PM
Changing color of a single gridline on a chart Anise Ahmed Microsoft Excel Charting 1 26th Sep 2003 09:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 PM.