Forum: EasyBoot
Topic: Need Help
started by: gold

Posted by gold on Sep. 15 2005,14:06
Iam using a startup disk created from windows 98. Anyone know how to debug command.com to change foreground color, I want to make the color light green to make it well visible.

I dont know how to use debug or a hex editor. Not experienced on that. So need a detailed help.

I tried to load Ansi.sys and change the color, that worked but Ansi.sys now slows down the display very much.

Found a link on this,
< http://browser.arachne.cz/archive/v01.n650 >
(Search for 'color' in the page)

I tried to follow the instructions, but failed because my dos version may be different.

Please someone help me to find a way.

Thanks in Advance.
Posted by eureka on Sep. 15 2005,17:14
To gold

A “work around” could bee to use a nice and small (7,63 kb) dos program to generate colours?

Download    A1.zip   (a bunch of dos utilities) from here:
< http://www.ers.kestar.com.au/download.html#DOS >

Extract A1.zip and then use   Fill.com  in Win98-image to get background (and foreground) colour.

Note: You can get a help screen bye starting fill.com in Windows (XP as well).

eureka
Posted by gold on Sep. 18 2005,14:23
eureka, First of all thanks for your reply but there is some problems :

1. When Fill.com is called to change foreground color it changes background color also.

2. When 'cls' is pressed it reloads default foreground color. Same happen when a dos program is called.

3. It is as slow as ansi.sys usage.

I had another link on patching command.com but it is not working for windows 98 startup disk command.com.

< http://www.empowermentzone.com/dos5doc.txt >
(Search for 'color' in the page)

If anyone know please help.
Posted by Tattenbach on Sep. 19 2005,10:22
Why don't you write the program in C using the winapi (windows.h)?

HANDLE  hConsole;      
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

SetConsoleTextAttribute(hConsole, k);

where 1<k>255

hope that helps
Posted by Tattenbach on Sep. 19 2005,10:24
sorry ...

where 1<k<255
Posted by gold on Sep. 21 2005,14:54
Tattenbach, sorry friend, i don't know c programming..

Iam very much new to these things. Thats why need a detailed help..
Posted by RDPetruska on Sep. 22 2005,09:38
Found in DOS help...

1. Add "device=c:\dos\ansi.sys" to your config.sys file (adjust path as necessary) to load ansi.sys.

2. enter "prompt $e[1;32;40m$p$g" at the command line.  If you like the colors, you can change to add this into autoexec.bat.  (This changes text to bold, text color to green, back color to black.)

Rob
Posted by Tattenbach on Sep. 22 2005,10:46
To program this in C is quite easy, you just need a compiler (most are free, like lccwin32). You write the lines that I gave you (and some other lines to include your DOS utilities)

Then you compile and link the program and create your own program (.exe) that will change to the colors of your choice and run your DOS applications (providing they are also in the same HDD - or you provide the path at the moment of compiling). Sounds difficult but it is easy. You can do it also in Quickbasic that's even easier to use but the compiler is not easy to find.
I'd love to write the program for you but then how do I send it to you?

The other choices are pre-written utilities as Eureka commented or using ansy (that, by the way, I don't think it really slows down your application).
Posted by Tattenbach on Sep. 27 2005,04:39
Sorry for the delay, Gold. I will write to you
Posted by Tattenbach on Sep. 30 2005,10:45
wrote to your e-mail address but got no reply so far.
Posted by gold on Oct. 01 2005,15:28
:( , Tattenbach sorry yet not got the mail, did it bounced ? can u send it once more ?
Posted by Tattenbach on Oct. 03 2005,06:09
Sent it again with this subject <<FAO: gold - 'Program to change color' >>
Posted by Tattenbach on Dec. 09 2005,03:03
Gold, here's the procedure to modify command.com included in Windows 98 SE:

This file is 93,890 bytes long so it cannot be modified with MS DEBUG because it (MS DEBUG) just handles up to 64K files.

I used the hex editor “FRHED” version 1.1.0 but any other similar (good) editor should work. I searched for the hex values B4 06 B7 07 32 DB all together. In B7 07 (exactly in the value 07) hides the fore and background colors of the prompt.  

When found (in my case in address BA1F) I changed the value 07 for a new value, like for example 0A for a light green foreground on a black background.

When ready saved the file with the same name.

ALWAYS keep a safe copy of the original command.com in case something goes wrong.  

This procedure was based on the article to be found at:

< http://www.textfiles.com/magazines/RRR/rrr199306.txt >

In there they still could used MS DEBUG because command.com (for DOS 6.0) was still under the 64K limit (FFFF hex). In any case any professional debugger should handle this task.
Posted by gold on Jan. 28 2006,16:41
Tattenbach, Thanks for your superb support.

Here I had written all the details to change color of dos (Windows 98 Second Edition dos boot disk specified in above post) by editing command.com.

(old link removed and here is the new link)
< http://rapidshare.de/files/13132153/Change_Color_Of_Dos.doc.html >

If link doesn't work, copy n paste it in browser.

Pictures are included, it will help to have a nice editing.


Posted by pivert on Jan. 29 2006,05:00
Impossible to go to your web page ! Allways get Tripod error about unavailable directory !
:O
Posted by Still impossible to get the file on Jan. 30 2006,18:15
Error message I get is :

Quote
"This file is hosted by Tripod, a Lycos®Network Site, and is not available for download. Please check out Tripod's Help system for more information about Remote Loading and our Remote Loading policy. "


:(  :(  :(
Posted by wanderer on Feb. 01 2006,10:50
Is this helpfull?
< http://www.easydos.com/menucolor.html >

Read this "If you find that the text on your screen is blinking, try setting the background color to a lower value (below 7)."

In my case i could set the background color on value 7,without a blinking text :)

Greetz
Posted by gold on Feb. 12 2006,15:58
Here is the alternative link. This link had to work. :)

Sorry, the old link worked when I tested. Now this one should be a valid one.

< http://rapidshare.de/files/13132153/Change_Color_Of_Dos.doc.html >

If any program is executed then color changes into old white on black mode. 'cls' will bring back the changed color. If here is any expert, who can tell another tip, that is stable, it is most welcome.


Posted by gold on Feb. 12 2006,16:02
Wanderer, if the value is larger than 7 then screen will blink, I think so.
Posted by wanderer on Feb. 13 2006,07:24
@gold
Quote
Iam using a startup disk created from windows 98. Anyone know how to debug command.com to change foreground color, I want to make the color light green to make it well visible.

Why bother command.com and a  hex editor if you want the foreground color (=text)light green?

Just change in config.sys of the Win98 startdisk,the menucolor from "menucolor=7,0" into "menucolor=2,0"

Or am i missing the point here?

example;
[menu]
menuitem=CD, Start computer with CD-ROM support.
menuitem=NOCD, Start computer without CD-ROM support.
menuitem=HELP, View the Help file.
menudefault=CD,30
menucolor=2,0

[CD]
device=himem.sys /testmem:off
device=oakcdrom.sys /D:mscd001
device=btdosm.sys
device=flashpt.sys
device=btcdrom.sys /D:mscd001
device=aspi2dos.sys
device=aspi8dos.sys
device=aspi4dos.sys
device=aspi8u2.sys
device=aspicd.sys /D:mscd001

[NOCD]
device=himem.sys /testmem:off

[HELP]
device=himem.sys /testmem:off

[COMMON]
files=10
buffers=10
dos=high,umb
stacks=9,256
devicehigh=ramdrive.sys /E 2048
lastdrive=z


Greetz


Posted by gold on Feb. 13 2006,16:49
It changes menu color only, after dos is fully loaded, I mean when we see 'A:\>', it loads the default colors only. Config.sys' 'Menu Color' won't change the color of prompt. Either Ansi.sys had to be loaded or Command.com had to be edited to get a changed color at prompt.

Thanks..


Posted by wanderer on Feb. 14 2006,08:42
@gold
Quote
It changes menu color only, after dos is fully loaded, I mean when we see 'A:\>', it loads the default colors only. Config.sys' 'Menu Color' won't change the color of prompt. Either Ansi.sys had to be loaded or Command.com had to be edited to get a changed color at prompt.

Thanks for your answer,i understand now better what you ment.
I used your tutorial;
< tutorial >

and it works perfect  :cool:

Thanks again and see you.
Posted by gold on Feb. 16 2006,14:44
Thanks, actually real credit goes to Tattenbach, who made all this possible, I just wrote the tutorial.

Take care..
Posted by wanderer on Feb. 16 2006,17:57
Quote
Thanks, actually real credit goes to Tattenbach, who made all this possible, I just wrote the tutorial.

Ok,then i say also thanks to Tattenbach  :)
My English is a bit poor you see,i didn't read all of the answers,just jump to the tutorial.

So thanks to you both and greetings from The Netherlands.
Posted by gold on Mar. 12 2007,18:02
Way to edit Command.com of Windows 98 SE Boot Disk to change color of dos.

1. Download and unzip FRHED v1.0.156 (Free Hex Editor) from this path.

< http://www.rs.e-technik.tu-darmstadt.de/applets/frhed156.zip >

Or Download and install FRHED v1.1

< http://www.rs.e-technik.tu-darmstadt.de/applets/frhed-v1.1.zip >

If you are experienced you can use any other Hex editor.

2. Backup a copy of Command.com (if any error occurs you can restore it)

3. Run 'frhed.exe', File > Open 'Command.com'

4. Go to Edit > Find > Copy and paste this string:

<bh:b4><bh:06><bh:b7><bh:07>2<bh:db>

5. The '07' in <bh:07> holds the information about color. So it had to be changed to get the required result. These are the values.

Black                - 0
Blue                 - 1
Green               - 2
Cyan                - 3
Red                  - 4
Magenta           - 5
Brown               - 6
White                - 7
Grey                  - 8
Bright Blue        - 9
Bright Green      - A
Bright Cyan       - B
Bright Red         - C
Bright Magenta - D
Yellow              - E
Bright White     - F

The first number represent background (in 07, '0' is for background), the second is for foreground color (in 07, '7' is for foreground). Don't enter a number larger than 7 for the first number or your screen will blink.

You can see these values:  |b7 07 32 db| Then Click on the '0' in Hex Editor window. Go to Edit > Enter Decimal Value > Key in 14.

The values will change like this |b7 0e 32 db|

The decimal value 14 is equal to hex value 0e. ‘0’ for black background and ‘e’ for yellow foreground. Decimal to Hex conversion tables can be searched in google.

6. Then save the file. Click on File > Save. Close the Hex editor and replace ‘Command.com’ of Windows 98 SE Boot Disk with the modified one. You can check the date to ensure that you had replaced the old one. The modified date will be current date. Now boot from new disk and check whether it is working. If any error occurs, then do the steps once more.

If any program is executed then the default colors are loaded. ‘cls’ will bring back the changed colors.