中国DOS联盟论坛

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-14 07:10
47,811 topics / 349,898 posts / today 1 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » [Share] Explanation of the Configuration File of the config System
Printable Version  31,274 / 243
Floor151 孤独情圣 Posted 2003-10-15 00:00
初级用户 Posts 2 Credits 113
Not bad, I think it's quite good.
Floor152 杨过 Posted 2003-10-15 00:00
初级用户 Posts 1 Credits 105
I can't understand it
Floor153 tim97 Posted 2003-10-15 00:00
初级用户 Posts 8 Credits 136
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
Floor154 benq Posted 2003-10-16 00:00
初级用户 Posts 6 Credits 131
Master Ru Shi, you haven't written for a long time. I can hardly wait anymore.
Floor155 gaojie Posted 2003-10-17 00:00
中级用户 Posts 31 Credits 224
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.
Floor156 gaojie Posted 2003-10-17 00:00
中级用户 Posts 31 Credits 224
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!!!
Floor157 linux1234 Posted 2003-10-17 00:00
中级用户 Posts 42 Credits 293
I'm a newbie, just checking in first.
Floor158 v_bird Posted 2003-10-18 00:00
初级用户 Posts 2 Credits 109
hehe, many thanks for the moderator's guidance, I'm a newbie, please teach me more from now on!
Floor159 zhmysh Posted 2003-10-18 00:00
初级用户 Posts 3 Credits 109
Thanks
Floor160 allul Posted 2003-10-22 00:00
初级用户 Posts 4 Credits 120
Master Ru Shi, are you very busy? Why aren't you continuing? We're still waiting for you. Don't be lazy now.
Floor161 sunny1979 Posted 2003-10-23 00:00
初级用户 Posts 86 Credits 376
Master Rushi, we're still waiting for you to continue.
Floor162 如是大师 Posted 2003-10-23 00:00
元老会员 Posts 3,351 Credits 9,654 From 湖北
I'm in Henan right now; once I get home I'll continue... Thanks for everyone's support...
Floor163 myqq166 Posted 2003-10-25 00:00
初级用户 Posts 14 Credits 151
Master Rushi, I have read your great work and benefited a great deal from it. Hope you'll come back and continue posting!!!!!!!!!!
Floor164 watsky Posted 2003-11-01 00:00
初级用户 Posts 1 Credits 105
I really gained a lot from this, many thanks to Master Rushi.
Floor165 wangfeng930 Posted 2003-11-12 00:00
初级用户 Posts 1 Credits 106
xie thanks
Prev  18 9 10 11 12 13 1417  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023