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-10-01 12:26
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » [Share] Explanation of the Configuration File of the config System View 33,063 Replies 243
Floor 151 Posted 2003-10-15 00:00 ·  中国 山东 临沂 联通宽带城域网统一出口
初级用户
★
Credits 113
Posts 2
Joined 2003-10-15 00:00
22-year member
UID 11311
Gender Male
Status Offline
Not bad, I think it's quite good.
Floor 152 Posted 2003-10-15 00:00 ·  中国 湖南 岳阳 电信
初级用户
★
Credits 105
Posts 1
Joined 2003-10-15 00:00
22-year member
UID 11313
Gender Male
Status Offline
I can't understand it
Floor 153 Posted 2003-10-15 00:00 ·  中国 上海 嘉定区 电信
初级用户
★
Credits 136
Posts 8
Joined 2003-10-04 00:00
22-year member
UID 10707
Gender Female
Status Offline
Is there more? I still want to read it. You're writing so slowly, so send it to me and I'll post it up for you.
Thanks! xiongrui97!@tom.com
人无千日好,花无百日红
Floor 154 Posted 2003-10-16 00:00 ·  中国 吉林 长春 教育网
初级用户
★
Credits 131
Posts 6
Joined 2003-08-30 00:00
23-year member
UID 9209
Gender Male
Status Offline
Master Ru Shi, you haven't written for a long time. I can hardly wait anymore.
Floor 155 Posted 2003-10-17 00:00 ·  中国 北京 263网络通信电信数据中心
中级用户
★
Credits 224
Posts 31
Joined 2003-09-28 00:00
23-year member
UID 10454
Gender Male
Status Offline
CONFIG.SYS file commands and configuration

CONFIG.SYS is an important file in the DOS system. Its configuration directly affects system use and efficiency. If it is configured improperly, many programs may not run normally. Therefore, correctly and reasonably configuring the CONFIG.SYS file is very necessary and important. Below I will introduce the commands in CONFIG.SYS and their configuration methods.

Commands in CONFIG.SYS:
Note: All commands ending in HIGH (such as DEVICEHIGH) mean loading them into UMB (upper memory), but some such commands (such as FILESHIGH) must be used in MS-DOS 7.x.

ACCDATE: Specifies whether to record the date each file was last accessed on each drive.
Usage: ACCDATE= drive 1+|- ...
For example: ACCDATE=C+ D+ E+ will record the date files were last accessed on drives C, D, and E.
This command is only used in MS-DOS 7.x.

BREAK: Sets or clears extended CTRL+C checking.
Usage: BREAK=ON|OFF

BUFFERS/BUFFERSHIGH: Allocates memory for a specified number of disk buffers.
Usage: BUFFERS=number of disk buffers,

DEVICE/DEVICEHIGH: Loads the specified device driver into memory.
Usage: DEVICE/DEVICEHIGH filename
Here, filename is the file's full path, such as C:\DOS\HIMEM.SYS.

DOS: Used for DOS system configuration, such as whether to use HMA (High Memory Area), etc.
Usage: DOS=
Here, HIGH and LOW mean using HMA or not using HMA, UMB and NOUMB mean using UMB or not using UMB, AUTO or NOAUTO mean automatic system configuration or not, and SINGLE means using single-mode DOS. Among them, AUTO/NOAUTO and SINGLE are only used in MS-DOS 7.x.

DRIVPARM: Sets parameters for existing physical devices.
Note: This command is rarely used, and I haven't used it either, so I'll skip it for now.

FCBS/FCBSHIGH: Specifies the number of file control blocks (FCBs) that can be opened at the same time.
Usage: FCBS/FCBSHIGH=number of FCBs that can be opened at the same time.
Note: Since FCBs were mainly used in DOS 1.x, for higher versions the system can be allowed to configure this automatically.

FILES/FILESHIGH: Specifies the number of files that can be accessed at the same time.
Usage: FILES/FILESHIGH=number of files that can be accessed at the same time.
Note: Generally, a setting of around 30 for FILES/FILESHIGH is more appropriate.

INSTALL/INSTALLHIGH: Used to load TSRs (memory-resident programs).
Usage: INSTALL/INSTALLHIGH=filename
For example: INSTALLHIGH=C:\DOS\DOSKEY.COM /APPEDIT

LASTDRIVE/LASTDRIVEHIGH: Specifies the last valid drive letter that can be accessed.
Usage: LASTDRIVE=drive letter
For example, LASTDRIVE=F will set F as the last valid drive letter.

NUMLOCK: Specifies whether the NUMLOCK indicator is on at startup.
Usage: NUMLOCK=ON|OFF

REM: Adds comments.
Usage: REM
Note: The string in the comment is only used to increase readability and will not be executed.

SET: Sets DOS environment variables.
Usage: SET variable=

SHELL: Specifies the name and location of the command interpreter used by DOS.
Usage: SHELL=filename
Note: The default filename is COMMAND.COM, and you can also specify other files, such as 4DOS.EXE.

STACK/STACKHIGH: Specifies the number of stacks to use.
Usage: STACK/STACKHIGH=number of stacks,size of each stack
Note: The value usually specified is 9,256, and this value can satisfy most needs.

SWITCHES: Specifies some special options.
Usage: SWITCHES= ]

The others are some menu configuration commands, such as MENUITEM, MENUCOLOR, etc.

In MS-DOS 7.x there are also some undocumented commands, such as LOGO, COMMENT, etc.

DOS batch files

There are three kinds of executable files under DOS: EXE, COM, and BAT. Among them, EXE and COM files are both binary, and only BAT files are text format and can be read directly. Therefore, compared with the above binary executable files, BAT files are much simpler in content. These files contain a collection of DOS commands and are usually called batch files. Although the structure of batch files is relatively simple, they are very useful and are used quite widely. For example, if you execute some of the same commands every time, you will certainly feel it is very troublesome, but if you put them in a batch file and execute them, it is much easier. AUTOEXEC.BAT is a special batch file. It runs automatically when DOS starts and plays a very large role in system configuration. Therefore, to learn DOS well, one must learn batch files well. Below I will introduce batch file commands and their use.

Batch commands built into DOS:

@:Put this symbol before other commands in the batch file, and when it runs, the command itself will not be displayed.
For example, the @ECHO OFF command is often used at the beginning of a batch file.

CALL: Calls another batch file from one batch file, and after the call finishes, continues executing the original batch file.
Usage: CALL
Note: You can also use the COMMAND /C command to accomplish the same operation.

CHOICE: Selection command. This is a DOS external command, but it is mainly used in batch files.
After the CHOICE command is executed, it will prompt for selectable items, and at this time you choose by pressing a key.
Usage: CHOICE:key list] choice value,seconds]
Here, /C indicates the selectable keys, /N indicates not to display the prompt information, /S indicates case-sensitive mode, and /T indicates that if no selection is made within the specified time, one of the choice values defined in /C will be executed automatically. The display text is the prompt shown when the CHOICE command is executed. The selection result will be represented by the ERRORLEVEL value.

ECHO: Displays specified information. Usually displayed on the screen.
For example, ECHO Hello will display the word Hello on the screen.
In addition, ECHO ON|OFF is used to set whether the command itself is displayed while the batch file is running. ECHO OFF and @ have the same meaning, but it is a standalone command and cannot be placed before other commands the way @ can.

FOR: Runs the corresponding command on the specified files.
As everyone knows, many DOS commands support wildcards under DOS, such as ? and *, making it very convenient to specify a group of files at once. However, not all DOS commands support wildcards. For example, TYPE (the file content display command) does not. With the FOR command this is no longer a problem, because it allows the TYPE command to display multiple files at once.
Usage: FOR %variable IN (file set) DO command
Note: The above is the fixed form of the FOR command. The positions of IN and DO must be correct, otherwise a syntax error prompt will appear.
For example, FOR %F IN (*.*) DO TYPE %F lets the TYPE command display multiple files at once.
Note: %F is the variable name, and %G etc. may also be used instead, but they must be consistent before and after. In a batch file use %%F instead.

GOTO: Jumps to a certain label inside the batch file and continues execution there.
As everyone knows, in programming it is often necessary to repeat or jump to some place to continue execution, such as the GOTO command in the BASIC language. The GOTO command in batch files can also accomplish similar functions.
Usage: GOTO
Here, the label name can be set arbitrarily, such as Hello, etc. A label is set with the ":" symbol, such as ":Hello". Then the GOTO Hello command will jump to the location of ":Hello" and continue executing the batch file.

IF: Conditional judgment command. This is a very useful batch command.
Usage 1: IF EXIST filename command
Meaning: if a file exist, execute a certain command.
Usage 2: IF ERRORLEVEL error return code command
Meaning: if the error return code is greater than or equal to the specified code, execute a certain command.
Here, ERRORLEVEL means the error return code, and it is very useful. For many DOS commands, since the execution results differ (such as execution succeeded, execution failed, or was interrupted by the user), these commands return different codes to indicate different results. The IF ERRORLEVEL command then executes different commands according to those different codes produced by the different results. It is usually used after a command. For example, IF ERRORLEVEL 1 ECHO OK! means that if the current error return code is greater than or equal to 1, the word "OK!" will be displayed on the screen.
Usage 3: IF string1==string2 command
Meaning: execute a certain command when string1 and string2 are equal.

PAUSE: Pauses execution of the batch file and displays "Press any key to continue".

REM: Adds comments. Used to increase file readability and will not be executed. :: may also be used instead.

SHIFT: Changes the position of replaceable parameters in a batch file.
Replaceable parameters are a special kind of parameter that can only be used in batch files. These parameters are entered by the user when executing the batch command. For example, if we execute the DIR /S /W command, DIR is the command name and /S and /W are its execution parameters. In a batch file, these command parameters are assigned to replaceable parameters respectively, so /S becomes %1 and /W becomes %2, and so on, while the command itself is assigned to %0. Batch files make use of replaceable parameters to operate on the parameters entered at execution time. For example, suppose there is a batch file called MYFILE.BAT, and at the command line you execute MYFILE.BAT YES. Then the value of %0 is MYFILE.BAT, and the value of %1 is "YES". In this batch file you can use IF and other commands to judge the values of parameters such as %1, and then perform different operations according to those different values, such as IF "%1"=="YES" GOTO YES.
The SHIFT command takes no parameters. The result is that the value of %0 is replaced with the original value of %1, and the original value of %1 becomes the original value of %2, and so on. Note its irreversibility. Because there may be many runtime parameters when a batch file is executed, possibly more than 10, while replaceable parameters only go from %0 to %9, if you want to obtain parameter values after %9, you can only use the SHIFT command. At that time, the whole parameter list is pushed forward.

The above are DOS built-in batch commands. As can be seen, there are very few such commands. If you want to write relatively complex programs, it is clearly impossible to do so with the above commands alone. At that point, other practical batch tools are needed. Famous and practical ones include TESTIF, STRING, ASET, BATCHMAN, WBAT, etc., all of which can be downloaded from "DOS software category downloads" under "script tools". Using the above tools in batch files can achieve very powerful functions, and can even accomplish many functions of high-level language programs. So, if you want to write batch files, they are a good choice for you. Not only do they have detailed documentation, they are also still being continuously developed.

Next comes discussing how to make batch files. Actually, making batch files is not difficult; you only need to master the method. As the number of times you operate increases, you will feel it becoming easier and easier.

First use a text editor, such as the EDIT command that comes with DOS or other editing tools such as PEDIT, to create a new blank file (of course, you can also create one directly with the COPY CON command), and then enter batch commands in it according to the function you want to accomplish. If you only want to execute a collection of DOS commands, then just enter one DOS command per line in sequence. But if you want to accomplish more complex operations, then you will need the above batch commands or the batch tools mentioned above.
Floor 156 Posted 2003-10-17 00:00 ·  中国 北京 263网络通信电信数据中心
中级用户
★
Credits 224
Posts 31
Joined 2003-09-28 00:00
23-year member
UID 10454
Gender Male
Status Offline
This is the webmaster's article!
Why does everyone always rely on others?
There are tons of articles online, can't you search for them!!!
Floor 157 Posted 2003-10-17 00:00 ·  中国 山东 烟台 联通
中级用户
★
Credits 293
Posts 42
Joined 2003-10-17 00:00
22-year member
UID 11396
Gender Male
Status Offline
I'm a newbie, just checking in first.
Floor 158 Posted 2003-10-18 00:00 ·  中国 黑龙江 哈尔滨 双城区 联通
初级用户
★
Credits 109
Posts 2
Joined 2003-06-11 00:00
23-year member
UID 4785
Gender Male
Status Offline
hehe, many thanks for the moderator's guidance, I'm a newbie, please teach me more from now on!
Floor 159 Posted 2003-10-18 00:00 ·  中国 陕西 西安 电信
初级用户
★
Credits 109
Posts 3
Joined 2003-10-18 00:00
22-year member
UID 11441
Gender Male
Status Offline
Thanks
Floor 160 Posted 2003-10-22 00:00 ·  中国 辽宁 沈阳 中移铁通
初级用户
★
Credits 120
Posts 4
Joined 2003-10-22 00:00
22-year member
UID 11686
Gender Female
Status Offline
Master Ru Shi, are you very busy? Why aren't you continuing? We're still waiting for you. Don't be lazy now.
Floor 161 Posted 2003-10-23 00:00 ·  中国 陕西 西安 电信
初级用户
★★
忍者
Credits 376
Posts 86
Joined 2003-10-16 00:00
22-year member
UID 11361
Gender Male
Status Offline
Master Rushi, we're still waiting for you to continue.
以C语言软件开发为主:http://sunny1979.icpcn.com
Floor 162 Posted 2003-10-23 00:00 ·  中国 河南 信阳 联通
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
I'm in Henan right now; once I get home I'll continue... Thanks for everyone's support...
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Floor 163 Posted 2003-10-25 00:00 ·  中国 内蒙古 赤峰 联通
初级用户
★
逸海游神
Credits 151
Posts 14
Joined 2003-10-25 00:00
22-year member
UID 11905
Gender Male
Status Offline
Master Rushi, I have read your great work and benefited a great deal from it. Hope you'll come back and continue posting!!!!!!!!!!
看时光如流水,~'~'~._
    (((\\~ _~'~.
     )a , ~ _~,,,~'~
    \_  /,-~,,~''
     \ )--. 
      \/  '
      )&,  ._ ',
      \_\_ ( '. \
       '.___'. 让美丽属于你!

我们的智慧来源于不断的学习,愿真诚和睿智永远陪伴着我们。

⊙ㄍ⊙ㄍ 我愿如鱼 ⊙ㄍ⊙ㄍ 游弋在知识的海 £ㄍ£
Floor 164 Posted 2003-11-01 00:00 ·  中国 辽宁 葫芦岛 联通
初级用户
★
Credits 105
Posts 1
Joined 2003-10-19 00:00
22-year member
UID 11484
Gender Male
Status Offline
I really gained a lot from this, many thanks to Master Rushi.
Floor 165 Posted 2003-11-12 00:00 ·  中国 河北 唐山 联通
初级用户
★
Credits 106
Posts 1
Joined 2003-10-29 00:00
22-year member
UID 12121
Gender Male
Status Offline
xie thanks
‹ Prev 1… 9 10 11 12 13 …17 Next ›
Forum Jump: