ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Color added to Dos (https://www.excelbanter.com/excel-programming/342224-color-added-dos.html)

Denny

Color added to Dos
 
I know color can be added to Dos, but how? I just want to add it to my find
command...just for fun.

Access101

Color added to Dos
 
Do you mean this (c:\Help color):

Sets the default console foreground and background colors.

COLOR [attr]

attr Specifies color attribute of console output

Color attributes are specified by TWO hex digits -- the first
corresponds to the background; the second the foreground. Each digit
can be any of the following values:

0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White

If no argument is given, this command restores the color to what it was
when CMD.EXE started. This value either comes from the current console
window, the /T command line switch or from the DefaultColor registry
value.

The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute
the COLOR command with a foreground and background color that are the
same.

Example: "COLOR fc" produces light red on bright white


"denny" wrote:

I know color can be added to Dos, but how? I just want to add it to my find
command...just for fun.


Denny

Color added to Dos
 
For me when I type (c:\Help color), it just says Bad command or file name. I
have Win 98. Do some DOS versions not have it. It is not in the directory.



Denny

Color added to Dos
 
I found a suitable answer, if anyone else wants to know. You have to put
this in your config.sys file. DEVICE=C:\windows\command\ANSI.SYS
The sequence used is $e[xx;yy;zzm xx=attribute code, yy=foreground color,
and zz=background color. An example is prompt $e[1;31;44m$p$g$e[1;33;44m

I used this one successfully--prompt $e[5;30;47m$p$g To SEARCH: Type F and
one search word____$e[1;30;44m
cls
It seemed to have to be run twice though to make the whole screen blue ????





All times are GMT +1. The time now is 04:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com