China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 03:24
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Repost: How to Use ANSI.SYS View 5,342 Replies 17
Original Poster Posted 2003-02-23 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
Sometimes we want DOS to display different colors or have some other functions. If we load ANSI.SYS when DOS starts, it can help us achieve these functions. Below is how to use it:
------------------------------

How to Use ANSI.SYS
ANSI.SYS is a very useful device driver in MS-DOS. With it, we can get display effects we would not normally expect. So how should it be used? Let me introduce it below.
Note: In this section, the uppercase letters in the syntax and ANSI escape sequences must be typed exactly as shown.

ANSI.SYS defines a series of functions used to change display graphics, control cursor movement, and redefine keys. The ANSI.SYS device driver supports ANSI terminal emulation for escape sequences, so as to control the system's screen and keyboard.

This device driver must be loaded by the DEVICE or DEVICEHIGH command located in the CONFIG.SYS file.

Syntax

DEVICE(HIGH)=ANSI.SYS

Parameters


Specifies the location of the ANSI.SYS file.

Options

/X
Remaps extended keys other than those on a 101-key keyboard.

/K
Makes the ANSI.SYS file treat a 101-key keyboard as an 84-key keyboard. This is equivalent to the command SWITCHES=/K. If you normally use the
SWITCHES=/K command, then when using ANSI.SYS, you need to use the /K option.

/R
When ANSI.SYS is used together with a screen reader (a program that makes computers easier to use for disabled people), this option adjusts line scrolling to improve readability.

Parameters used in ANSI escape sequences:

Pn
Numeric parameter, used to specify a decimal number.

Ps
Optional parameter. Specifies a decimal number used to select a function. You may specify multiple functions, and the parameters must be separated by semicolons (.

PL
Line parameter. Specifies a decimal number representing a line on the display or other device.

Pc
Column parameter. Specifies a decimal number representing a column on the screen or other device.

Cursor movement, graphics, and keyboard settings in ANSI escape sequences:

In the list of ANSI escape sequences below, the abbreviation ESC stands for ASCII escape character 27(1Bh), which appears at the start of each escape sequence.

ESC






























































































































































93 125 29 0;27
92 124 28 0;43
; 59 58 -- 0;39
' 39 34 -- 0;40
, 44 60 -- 0;51
. 46 62 -- 0;52
/ 47 63 -- 0;53
` 96 126 -- 0;41
Normally, when you press the ESC key at the DOS prompt, the screen will display a backslash (\) and move the cursor to the next line. At this time you can use the PROMPT command. Suppose the current DOS prompt is $P$G. If you want to clear the screen, you can type:
PROMPT=$E

欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 2 Posted 2003-02-23 00:00 ·  中国 河北 石家庄 联通
银牌会员
★★★
Credits 1,833
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
This is Wengier's stuff again, right?
I looked for it for a long time before and couldn't find it. After finding it, why did it suddenly become so easy to run across??
Floor 3 Posted 2003-02-24 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
Right, I had used ANSI.SYS before too, but I never found any detailed reference material, so I could only mess around on my own. Later I saw this article was pretty good, so I immediately saved it to my collection.
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 4 Posted 2003-02-24 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
Time prompt under DOS

If you want to display the date and time anywhere on the screen in a bright foreground color, you can enter the following file

and save it as TIMER,BAT.

@E CHO OFF
IF "%1"==""GOTO HELP
GOTO OK
:HELP
ECHO SYNTAX:TIMER A B C D
ECHO A=TEXT COLOR 30=BLACK 31=RED
ECHO 32=GREEN 33=YELLOW
ECHO 34=BLUE 35=MAGENTA
ECHO 36=CYAN 37=WHITE
ECHO B=BACKGROUND 40=BALCK 41=RED
ECHO 42=GREEN 43=YELLOW
ECHO 44=BLUE 45=MAGENTA
ECHO 46=CYAN 47=WHITE
ECHO C=R NUMBER
ECHO D=COLUMN NUMBER
GOTO EXIT
:OK
PROMPT $P$G$E








欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 5 Posted 2003-02-27 00:00 ·  中国 河北 石家庄 联通
银牌会员
★★★
Credits 1,833
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
I suggest the post above be made into a separate thread.
Floor 6 Posted 2003-02-28 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
What you said is true, but I wanted to use it as an application example of how to use ANSI, an example to illustrate ANSI usage.
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 7 Posted 2003-03-02 00:00 ·  中国 河北 石家庄 联通
银牌会员
★★★
Credits 1,833
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
But changing screen colors does sound more appealing than using ANSY.SYS after all.
Floor 8 Posted 2003-03-02 00:00 ·  中国 河北 石家庄 联通
银牌会员
★★★
Credits 1,833
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
But changing screen colors does sound more appealing than using ANSY.SYS after all.
Floor 9 Posted 2003-03-03 00:00 ·  中国 香港 香港教育大学
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
The one at the top seems to have been reposted from the Windows98 Readme file.
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Floor 10 Posted 2003-03-03 00:00 ·  中国 河北 石家庄 联通
银牌会员
★★★
Credits 1,833
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
Hehe
Seems so.
There are a lot of good things in the *.txt files under the Windows system directory.
Floor 11 Posted 2003-04-10 00:00 ·  中国 福建 福州 电信
高级用户
★★
Credits 748
Posts 188
Joined 2003-03-28 00:00
23-year member
UID 1302
Gender Female
Status Offline
I want to ask the experts: how do I set the color of filenames, for example, showing .SYS in blue, .ZIP in yellow, and so on?
Floor 12 Posted 2003-04-10 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
The following is quoted from 阿海 at 2003-4-10 23:00:48:
I want to ask the experts: how do I set the color of filenames, for example, showing .SYS in blue, .ZIP in yellow, and so on?


The best way is to use SuperDIR. You can download it from the site's "File Tools" section.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 13 Posted 2003-04-10 00:00 ·  中国 福建 福州 电信
高级用户
★★
Credits 748
Posts 188
Joined 2003-03-28 00:00
23-year member
UID 1302
Gender Female
Status Offline
But SDIR does not support Chinese.
Floor 14 Posted 2003-04-10 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Start a DOS Chinese character support system first, such as UCDOS or CCDOS97, then run SDIR and it will support Chinese.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 15 Posted 2003-04-10 00:00 ·  中国 福建 福州 电信
高级用户
★★
Credits 748
Posts 188
Joined 2003-03-28 00:00
23-year member
UID 1302
Gender Female
Status Offline
No, I tried it, it can't display it.
Forum Jump: