ANSI.COM

The text below is excerpted from the PC Magazine Website:

Description: ANSI.COM is a memory-resident utility that enables selectable use of the extended screen and keyboard control sequences that normally require loading the ANSI.SYS device driver. Unlike ANSI.SYS, ANSI.COM supports all video modes, permits sizing and clearing the key-assignment buffer, and provides high-speed screen updating.

ANSI.COM was written by PC Magazine's Michael J. Mefford, and first appeared in PC Magazine February 7, 1989 (v08v02?). This very old program has much use today, because Windows Me doesn't allow ANSI.SYS to load. If you have batch files, or antiquated programs that rely on the system processing ANSI escape sequences, then ANSI.COM is indispensable.
Where to Get the ANSI.COM Program

You can download ANSI.COM from the PC Magazine Website, or from Rob van der Woude's Scripting Pages. Or you can just copy it from this website by right-clicking  here, and then selecting Save Link Target As... The Save As dialog-box will then appear. If ANSI.COM.html appears in the File name field, rename it ANSI.COM (delete the .html extension) before you click on the Save button.

Make sure that you copy ANSI.COM to the folder C:\WINDOWS\COMMAND -- in order that the batch-files presented herein can find it. (If you copy ANSI.COM to a different location, then you'll have to edit these batch-files to refer to that changed location.)


More information on ANSI.COM -- Compiled by Yosl

ANSI.COM is a small DOS program that loads ANSI.SYS into computer memory directly from the command-line, thereby eliminating the need for a DEVICE=ANSI.SYS (or DEVICE=C:\WINDOWS\COMMAND\ANSI.SYS) statement in your CONFIG.SYS file.

Loading ANSI.SYS directly from the command-line is essential for Windows ME (Windows Millenium), because Windows ME does not support CONFIG.SYS files.

In other words, in Windows ME the only way to load ANSI.SYS is to load it from the command-line -- and that requires the use of ANSI.COM.

But why do we need ANSI.SYS loaded at all? The answer is that many batch files (including all that are presented on this website) use ANSI.SYS codes for attractive colorful displays on your monitor screen.

Without ANSI.SYS being loaded into memory, the on-screen displays would be almost unintelligible, as shown is this example:

¬Tue 09-28-2004 13:16:39.51  To return to the WINDOWS Desktop, type X
¬[37m
J:\BAT)bu.bat
¬[1m¬Incorrect value or no value has been set for %1!¬[40m
¬Press any key to abort and exit...¬[40m

Here is an example of how the display appears with ANSI.SYS loaded into memory.

   Tue 09-28-2004 13:20:16.47  To return to the WINDOWS Desktop, type X
J:\BAT)bu.bat
Incorrect value or no value has been set for %1!
Press any key to abort and exit...

See how much nicer it looks.

For this reason, I always include a line ANSI.COM > nul at the beginning of each batch-file that I run in Windows ME (in a Command-Prompt Window a/k/a DOS-Box).

By the way, the > nul redirection symbol is used for the following reason: If you don't use the redirection symbol, then the following text will appear on your monitor screen every time your batch-file executes the ANSI.COM program:

ANSI 1.3 (C) 1988 Ziff Communications Co.
PC Magazine þ Michael J. Mefford
Syntax:  ANSI [FAST | SLOW][ON | OFF][/B nnn][/C][/U]
FAST = direct screen writes; default
SLOW = screen writes via BIOS
ON/OFF = active/inactive; default is ON
nnn = buffer size in bytes (0-60K) reserved for key reassignment; default 200
/U = Uninstall
Status: ON  FAST
Buffer size: 200
Bytes free:  200


Technical Stuff

You don't need the line ANSI.COM > nul in your batch file if you run a batch-file in Windows 98 or in RealMode DOS, and if you have in your CONFIG.SYS file a DEVICE=ANSI.SYS statement. This is because the DEVICE statement loads ANSI.SYS into memory. (But there is no harm in having the line in your batch file.  This is because if the batch file executes ANSI.COM, and ANSI.COM detects ANSI.SYS already in memory, then ANSI.COM just won't load.)

Moreover, if you are running Windows ME, and if you have the line ANSI.COM > nul in your C:\Windows\Command\CMDINIT.BAT file, then  you also don't need it in your batch-file -- provided that you firstly open a Windows ME DOS-Box, and then start your batch-file inside that DOS-Box.

However, if you are running Windows ME, and if you open the batch-file from the RUN command on the Windows Start-Menu, then you do need the line ANSI.COM > nul in your batch file.

Explanation: The file C:\Windows\Command\CMDINIT.BAT is automatically executed by Windows ME every time you open a DOS-Box. So if your CMDINIT.BAT file contains the line ANSI.COM > nul, then ANSI.SYS will automatically be loaded into memory when you first open the DOS-Box -- so that theoretically you don't need to have the line ANSI.COM > nul in your batch file. However, as I mentioned above, there is no harm in having the line in your batch file, because if the batch file executes ANSI.COM, and ANSI.COM detects ANSI.SYS already in memory, then ANSI.COM just won't load.