![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-10 16:53 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS启动盘 & LOGO技术 (启动盘室) » Repost: How to Use ANSI.SYS |
| Printable Version 5,536 / 17 |
| Floor1 Lydong | Posted 2003-02-23 00:00 |
| 元老会员 Posts 407 Credits 1,468 From 广州 | |
|
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 |
|
| Floor2 LanE | Posted 2003-02-23 00:00 |
| 银牌会员 Posts 648 Credits 1,835 | |
|
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?? |
|
| Floor3 Lydong | Posted 2003-02-24 00:00 |
| 元老会员 Posts 407 Credits 1,468 From 广州 | |
|
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.
|
|
| Floor4 Lydong | Posted 2003-02-24 00:00 |
| 元老会员 Posts 407 Credits 1,468 From 广州 | |
|
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 |
|
| Floor5 LanE | Posted 2003-02-27 00:00 |
| 银牌会员 Posts 648 Credits 1,835 | |
|
I suggest the post above be made into a separate thread.
|
|
| Floor6 Lydong | Posted 2003-02-28 00:00 |
| 元老会员 Posts 407 Credits 1,468 From 广州 | |
|
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.
|
|
| Floor7 LanE | Posted 2003-03-02 00:00 |
| 银牌会员 Posts 648 Credits 1,835 | |
|
But changing screen colors does sound more appealing than using ANSY.SYS after all.
|
|
| Floor8 LanE | Posted 2003-03-02 00:00 |
| 银牌会员 Posts 648 Credits 1,835 | |
|
But changing screen colors does sound more appealing than using ANSY.SYS after all.
|
|
| Floor9 Roy | Posted 2003-03-03 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
|
The one at the top seems to have been reposted from the Windows98 Readme file.
|
|
| Floor10 LanE | Posted 2003-03-03 00:00 |
| 银牌会员 Posts 648 Credits 1,835 | |
|
Hehe
Seems so. There are a lot of good things in the *.txt files under the Windows system directory. |
|
| Floor11 阿海 | Posted 2003-04-10 00:00 |
| 高级用户 Posts 188 Credits 748 | |
|
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?
|
|
| Floor12 Wengier | Posted 2003-04-10 00:00 |
| 系统支持 Posts 10,521 Credits 27,736 | |
The following is quoted from 阿海 at 2003-4-10 23:00:48: The best way is to use SuperDIR. You can download it from the site's "File Tools" section. |
|
| Floor13 阿海 | Posted 2003-04-10 00:00 |
| 高级用户 Posts 188 Credits 748 | |
|
But SDIR does not support Chinese.
|
|
| Floor14 Wengier | Posted 2003-04-10 00:00 |
| 系统支持 Posts 10,521 Credits 27,736 | |
|
Start a DOS Chinese character support system first, such as UCDOS or CCDOS97, then run SDIR and it will support Chinese.
|
|
| Floor15 阿海 | Posted 2003-04-10 00:00 |
| 高级用户 Posts 188 Credits 748 | |
|
No, I tried it, it can't display it.
|
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |