中国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-13 00:55
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS学习入门 & 精彩文章 (教学室) » Common DOS Commands (Part 2) 1
Printable Version  672 / 0
Floor1 欧阳慧仪 Posted 2003-10-07 00:00
初级用户 Posts 10 Credits 140
Maintaining a DOS system

Only with good maintenance can a system deliver good results. So, how should a DOS
system be maintained?

First, regularly check the disk for errors. Under DOS there are many commands that can
be used to check disks, such as CHKDSK, SCANDISK, etc. An even more powerful disk utility is
Norton's Disk Doctor, which has a friendly interface and powerful features, and can be
downloaded from this site's "Disk Utilities" section. Only by checking disks regularly can
stable disk operation be ensured.

Second, check for viruses regularly. Computer viruses are destructive programs that can
seriously endanger system security and data integrity. If allowed to run wild, they may cause
serious losses. Therefore, regular virus checking is very important and necessary. To check
for viruses, you need good antivirus software, and you should also update the virus database
frequently, otherwise it will not be effective. Useful DOS antivirus software includes F-PROT,
Norton AntiVirus, KV3000, etc. Especially the earlier F-PROT and NAV, both released by world-
famous major companies and still being constantly updated, so they work very well, and can be
downloaded from this site's "Antivirus Software" section. However, since new viruses keep
appearing, you should regularly download new virus databases for these antivirus programs to
achieve the best results. Of course, relying only on antivirus software without paying
attention to prevention is also not enough. Virus prevention is usually more effective than
virus removal, because it can greatly reduce the possibility of infection. There are many ways
to prevent viruses, such as using virus firewall programs and not using software from unknown
sources. Through these methods, viruses usually cannot get in.

Then, regularly back up important data. Because even if the previous two measures are
used, they can only greatly reduce the possibility of data being damaged, not guarantee peace
of mind. Data loss caused by misoperation or hardware failure can happen at any time.
Therefore, backing up data is extremely necessary. Usually you can back it up to floppy disks
or other hard disks as a precaution, so you will not regret it later. Things like disk
partition tables and boot records should also be backed up. Many tools can do this, such as
SRC Tools, BFHF, and so on. SRC Tools in particular is very convenient to use, and can be
downloaded from this site's "Disk Utilities" section. There is also an article in this site's
"DOS Articles" section introducing its detailed usage.

Of course, some other maintenance is also needed, such as regularly defragmenting the
disk, deleting junk files, and organizing files and software into categories for convenient
use.

Maintenance of system configuration is also very important. You can also use some utility
software for automatic maintenance, such as MEMMAKER. This can effectively save time and
effort.

Memory configuration under DOS

We all know that DOS generally cannot completely rely on a man-machine interface to
complete system configuration step by step. If you want the system to deliver maximum
performance, you must rely on further effort of your own. Below is an introduction to DOS
memory configuration methods.

Real-mode DOS usually can only use memory space below 1M. Of that, conventional memory
is 640K, while upper memory requires corresponding memory managers. Management of conventional
memory is especially important, because improper use may cause some programs to fail to run.
So, how should its use be optimized? Here are some suggestions.

First, load a memory manager that provides upper memory blocks (UMB). Common ones are
EMM386 and QEMM, but these tools themselves occupy quite a lot of memory. What I recommend
here is UMBPCI, a tool still under development, which can provide up to 162K of UMB, and if
placed before HIMEM it can use no conventional memory at all. Then, load all device drivers /
TSRs into UMB (using DEVICEHIGH, LOADHIGH, etc.). This way, even if many drivers are loaded
(such as CD-ROM, mouse, etc.), the remaining conventional memory will still be very high,
even 630K. Note that you should use drivers that take up as little memory as possible, so as
to free the maximum amount of UMB.

The following is the memory status information shown by the MEM/A/C command on my computer
(MS-DOS 7.10):

Modules using memory below 1 MB:

Name Total Conventional Upper Memory
-------- ---------------- ---------------- ----------------
SYSTEM 32,736 (32K) 9,664 (9K) 23,072 (23K)
HIMEM 1,168 (1K) 0 (0K) 1,168 (1K)
SETVER 864 (1K) 0 (0K) 864 (1K)
VIDE-CDD 5,024 (5K) 0 (0K) 5,024 (5K)
CLOAKING 1,168 (1K) 0 (0K) 1,168 (1K)
IFSHLP 2,864 (3K) 0 (0K) 2,864 (3K)
COMMAND 7,424 (7K) 0 (0K) 7,424 (7K)
KILLER 400 (0K) 0 (0K) 400 (0K)
WATCH 3,392 (3K) 0 (0K) 3,392 (3K)
MSCDEX 2,816 (3K) 0 (0K) 2,816 (3K)
DOSKEY 5,744 (6K) 0 (0K) 5,744 (6K)
CTMOUSE 3,344 (3K) 0 (0K) 3,344 (3K)
ZENO 1,376 (1K) 0 (0K) 1,376 (1K)
ESCAPE 496 (0K) 0 (0K) 496 (0K)
Free 750,080 (732K) 645,328 (630K) 104,752 (102K)

Memory Summary:

Type of Memory Total Used Free
---------------- ----------- ----------- -----------
Conventional 655,360 10,032 645,328
Upper 163,904 59,152 104,752
Reserved 393,216 393,216 0
Extended (XMS) 49,119,168 82,880 49,036,288
---------------- ----------- ----------- -----------
Total memory 50,331,648 545,280 49,786,368

Total under 1 MB 819,264 69,184 750,080

Largest executable program size 645,312 (630K)
Largest free upper memory block 103,952 (102K)
Available space in High Memory Area 5,360 (5K)
MS-DOS is resident in the high memory area.

From the table above, you can see that I loaded the following resident programs and drivers:

HIMEM: the XMS driver that comes with DOS.
SETVER: the DOS version table program.
VIDE-CDD: a universal CD-ROM driver. If your CD-ROM is USB, then use DUSE.
CLOAKING: the memory CLOAKING API and DPMS driver, used to save MSCDEX memory usage.
IFSHLP: a 32-bit disk service program, used under Windows 9x; it does not need to be loaded.
COMMAND: the DOS command processor.
KILLER: automatically intercepts incorrect instructions to prevent crashes.
WATCH: one of TSR Utils; the DISABLE command uses it to disable the functions of other TSR
programs.
MSCDEX: MSCDEX used together with the CLOAKING program; it uses less than 3K of memory,
otherwise it would use about 30K.
DOSKEY: the keyboard buffer and history program included with DOS.
CTMOUSE: a universal DOS mouse driver; it uses little memory and is also very fast.
ZENO: a display acceleration program.
ESCAPE: at any time you can press the F12 key to return to DOS mode, to prevent crashes.

Of course, I also loaded quite a few non-resident programs. If you want to know the specific
settings in my CONFIG.SYS file, see the "Commands and Configuration of the CONFIG.SYS File"
below.

Commands and configuration of the CONFIG.SYS file

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 methods of configuring them.

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 dates 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 the 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 full path of the file, such as C:\DOS\HIMEM.SYS.

DOS: used for configuring the DOS system, such as whether to use HMA (High Memory Area), etc.
Usage: DOS=
Here, HIGH and LOW mean use HMA or do not use HMA, UMB and NOUMB mean use UMB or do not use
UMB, AUTO or NOAUTO mean automatic system configuration or not, and SINGLE means using DOS in
single mode. Among these, 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 have not used it either, so I will skip it for now.

FCBS/FCBSHIGH: specifies the number of file control blocks (FCB) that can be opened at the
same time.
Usage: FCBS/FCBSHIGH=number of FCBs that can be opened at the same time.
Note: since FCB is mainly used in DOS 1.x, for higher versions the system can be allowed to
configure it 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 value of around 30 for FILES/FILESHIGH is appropriate.

INSTALL/INSTALLHIGH: used to load TSRs (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 light is on at startup.
Usage: NUMLOCK=ON|OFF

REM: adds comments.
Usage: REM
Note: the string in the comment is only used to improve 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, etc.

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.

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

After knowing the above commands, it is time to talk about how to use these commands to
configure the CONFIG.SYS file. The quality of the configuration has a very large impact on the
system. Below is the content of the CONFIG.SYS files on my computers (all MS-DOS 7.10), which
everyone can use for reference.

Computer 1, using EMM386.EXE:

device=d:\tools\dostools\echo.sys L/o/a/d/i/n/g CONFIG.SYS...
device=d:\tools\mdctools\himem.sys /testmemff
device=d:\tools\mdctools\emm386.exe noems novcpi i=b600-b7ff
devicehigh=d:\tools\mdctools\setver.exe
devicehigh=d:\software\pwin98se\ifshlp.sys
devicehigh=d:\tools\dostools\vide-cdd.sys /d:CDROM1
devicehigh=d:\tools\dostools\cloaking.exe
country=086,936,d:\tools\mdctools\country.sys
shell=c:\command.com /p /e:640
set temp=e:\temp
set tmp=e:\temp
accdate=c+ d+ e+
dos=high,umb
numlock=off
files=30
buffershigh=30,0
fcbshigh=4,0
lastdrivehigh=n
stackshigh=9,256

Computer 2, using UMBPCI.SYS:

device=d:\tools\dostools\echo.sys L/o/a/d/i/n/g CONFIG.SYS...
device=d:\tools\dostools\echo.sys
device=d:\tools\dostools\umbpci.sys
device=d:\tools\dostools\hiram.exe
devicehigh=d:\tools\mdctools\himem.sys /testmemff
devicehigh=d:\software\pwin98se\setver.exe
devicehigh=d:\software\pwin98se\ifshlp.sys
devicehigh=c:\dos\vide-cdd.sys /d:CDROM1
shell=d:\tools\mdctools\command.com /p /e:640
set temp=e:\temp
set tmp=e:\temp
accdate=c+ d+ e+
dos=high,umb,auto
country=086
numlock=off
fileshigh=30
buffershigh=30,0
stackshigh=9,256
lastdrivehigh=n

You may as well give it a try; I believe you can also make a good CONFIG.SYS file.

Back to top


--------------------------------------------------------------------------------

DOS batch files

There are three kinds of executable files under DOS: EXE, COM, and BAT. Among them, EXE
and COM files are both in binary form; only BAT files are in text form and can be read
directly. Therefore, compared with the above binary executable files, BAT files are much
simpler in content. These files contain collections of DOS commands and are usually called
batch files. Although batch files are relatively simple in composition, they are very useful
and widely used. For example, if you execute the same commands every time, you will surely
find it very troublesome, but if they are placed in a batch file and executed, it is much
easier. AUTOEXEC.BAT is a special batch file that runs automatically when DOS starts, and
plays a very large role in system configuration. Therefore, to learn DOS well, you must learn
batch files well. Below is an introduction to the commands in batch files and how to use them.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023