Is there a similar command like COLOR in MS-DOS?

0

0

MS-DOS 6.22 is running. Who needs Windows 10?

I know that upon starting there is a possibility to change the foreground and background color of the MS-DOS environment.

But is this also possible when MS-DOS is already running?

My case is, that I want to run a .BAT file, that then switching the color whether it throws an error or is ok.

Trollwut

Posted 2015-08-07T15:14:16.060

Reputation: 391

Answers

2

There are two possibilities:

  1. You install ANSI.SYS or any other ANSI driver. Then you just write an escape sequence to the screen, e.g. ESC [ 37 ; 44 m, where ESC is the Escape character (0x1b) and without any spaces. This sequence will change the color of the following text to "white on blue". If you can input the ESC character into your BAT file, this works well (try Ctrl+P ESC in DOS EDIT).
  2. You directly change the screen memory at 0xB800. This way you can also change the color of existing text without removing (and rewriting) it first. You probably need an external tool (DEBUG should suffice, though) to be able to change display memory. Also, it probably only works on IBM-PC compatible systems with a CGA-compatible graphics card.

Sebastian R.

Posted 2015-08-07T15:14:16.060

Reputation: 364

I will work on that on Monday, thanks for your response! – Trollwut – 2015-08-07T16:10:26.390