ANSI.ART ·
ART ·
2.7 KB ·
1986-09-29 ·
from CompuLink-User-Group_Magazette_Vol-2-Issue-2_1986
This small batch file redefines the F9 key to print 'dir ' on the
screen, you can insert any text you like in the quotes. To use it you
must have the line
device=ansi.sys
in your config.sys file and ansi.sys on your boot disk
In your Autoexec.bat file (anywhere) put the following code. The second
line prints 'dir = F9' on the screen, this line may be deleted if you
like.
echo off
echo [AF9 = "dir "[K
echo [0;67;"dir "p
echo [A
(The ^[ character is an ASCII 27 or Esc character, it cannot be printed
from DOS using the 'copy con:*.bat' command, so a text editor or word
processor will have to be used. In Wordstar, ctrl P then ctrl [ will
do, the same for Sidekick. The character may look like ^[ but it may be
a left arrow or an inverse square bracket, depending on the editor.
Play around, you should get there in the end, an idea is to load this
article into your editor and see what character it uses for ASCII 27,
or delete all the text and build your batch file around the one above.
For convenience sake, the batch file is included on this disk as
FKEY9.BAT, run it to see what it does (remember to boot with ANSI.SYS
on your boot disk and 'device=ansi.sys' in your config file.
Another nice feature of ANSI graphics are bold and flashing characters,
this example changes your dos prompt, type it in at the dos command
line or put it in your autoexec file.
prompt=$e[1m$p$g$e[m
^
This number is the important one,
1 bolds the text,
2 doesnt seem to do anything (I am using a mono graphics screen so I
cant tell if it produces other colours)
3 see 2
4 hides the text
5 flashes the text
6 see 2
7 inverts text
8 see 4
9 and above seem to have no effect
$b gives this character |
$d gives the current date
$g gives this character >
$h sets number of characters of a string to print
eg prompt $d$h$h$h$h$h$h$h$h$h$h will give just the day no date.
$l gives this character <
$n gives current default drive
$p gives current default drive and current subdirectory
$q gives this character =
$t gives the current time
$v gives DOS version number
All these can be put together on one line, (if you wish) as well as any
other text you want eg
prompt $e[1mAlans PC, keep off$e[m$n}
Play around with these, you can get some very intresting results. There
are many other things hidden in DOS, I just haven't found them yet. If
you have, I would love to hear from you.
Matthew