Ansi.sys is an enhancement of the "CON" device driver built into Command.com. It can be used to modify the default display colours, the position of the cursor, and how keystrokes are interpreted. It can also be used to change the video mode.
Ansi.sys can only be loaded in Config.sys using a Device or DeviceHigh statement.
Device=[Path]Ansi.sys [/X|/K] [/R] or
DeviceHigh=[Path]Ansi.sys [/X|/K] [/R]
|Path||The full path (usually: c:\windows\command). Default is the root directory of the start-up drive (usually C:/)|
|/X||Enables remapping of the extended keys on a 101-key keyboard.|
|/K||Causes a 101-key keyboard to behave as an 84-key keyboard.|
|/R||Invalid switch (?)|
|/L||Valid but not functional 1|
- Once Ansi.sys has been loaded, it's various functions can be accessed at any time by sending one or more "Escape Sequences" to the screen. These are tabulated in Ansi.sys Commands
- Unfortunately, Escape Sequences cannot be directly entered at the command line because the first character (ASCII 27 or "ESC") is interpreted as an instruction to "clear the command line" which doesn't get you very far. Fortunately, a number of workarounds have been developed - see "Entering Escape Sequences".
- The most common situations in which Ansi.sys is called for are:
It should be appreciated that most DOS programs write directly to the screen and bypass Ansi.sys altogether. Thus both colour and keyboard changes will generally only apply when using Dos commands and the supplied utilities such as FDISK and FORMAT.
- The construction of fancy prompts and menus (see PROMPT); and
- Remapping little used keys on the keyboard
- As far as I can determine, the "extended keys" that can be remapped by including the /X switch are the 10 keys between the main and number keypads on the standard 104 key keyboard - ie. Insert, Home, Page Up, Page Down, Delete, End, and the cursor keys. These keys all have scan codes beginning with 224 and it appears that, without the /X switch, this is read as "0" and become indistinguishable from the equivalent keys on the number keypad.
- According to Msdosdrv.txt on the Win98SE CD, the /R switch
"Adjusts line scrolling to improve readability when ANSI.SYS is used with screen-reading programs (which make computers more accessible to people with disabilities)"
However, on my machine Ansi.sys will not load when this switch is specified. Furthermore, scanning through the code with EDIT, I can find /X, /K/, /L, /S and /SCREENSIZE - but no trace of /R. Very odd!
|File Name||Default Location||Dos Ver.||Win Ver.||Size||Date||Source|
Superscripts denote which same size files, if any, are identical (using FC).