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-22 08:50
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Excerpts from "DOS Operating System 3.3 and Its Applications" View 2,719 Replies 10
Original Poster Posted 2007-03-28 04:03 ·  中国 北京 雅虎中国
中级用户
★★
菜鸟总动员
Credits 259
Posts 112
Joined 2006-08-28 15:53
19-year member
UID 61454
Status Offline
@Echo off

Title "Application of DOS Operating System 3.3" -- Compiled by Xie Dehuang et al., Aerospace Press

:: Recently borrowed a book from the library, there's nothing exciting. I picked out these things according to my personal situation,
:: It's a simple record of my study these days, for reference only for novices, please don't laugh at veterans!

Echo "
1 Several usages of Copy:

1) copy *.txt+*.rtf *.doc Each file that meets *.txt is combined with the *.rtf file with the same name, and the result is stored in a file with the same name but with the extension .doc.
2) copy *.txt+*.rtf combin.doc All .txt and .rft files will be integrated into the combin.doc file.
3) copy a.txt+*.txt All *.txt except a.txt will be appended to a.txt. (If there is no target path behind, the copy command defaults to copying the source to the current path. The copy command will compare the source file name with the target file name, and skip an input file if they are the same. When using copy to stack two files, if the target is not explicitly named, the target uses the source first file name)

2 A batch command can call itself recursively, but there must be an ending condition at the end of the file.

3 Spaces can be contained in the label, but no other separators, such as ; or =.

4 There is no Shift command to move backward. Once it is executed, the original parameter position cannot be restored. (Irreversible)

one example:

rem mycopy.bat copies any number of files to a directory.
rem the command is mycopy dir files
set todir=%1
:one
shift
if "%1"=="" goto two
copy %1 %todir%
goto one
:two
set todir=
echo all done


(No matter how many parameters are entered later, through "shifting", all are processed)

5 ANSI.sys is a driver used to replace the lack of screen and keyboard formats established in the operating system and computer BIOS. The function of ANSI.sys is to intercept characters from the keyboard, and either send these characters to the DOS system without change, or provide new redefined characters or strings. At the same time, the ANSI.sys driver can also control display performance, including screen color, cursor position and system prompt information.

6 When dealing with temporary batch files, usually add: Erase %0 at the last command line of the file.

7 In the IF statement, in addition to using quotes to represent parameters, you can also use a period (.) or lowercase letter x. For example, if .%1==. goto help. (In fact, this point can be extended, and other arbitrary symbols can be used instead. The key is to see if it meets the judgment condition. Adding these things is just adding some embellishments. But the effect should be equivalent to "", just see which you like.)

8 In For, the set of the collection can also be a set of commands. For example: for %%a in (copy del) do %%a B:\*.* A:\ Copy all files under drive B (root directory) to drive A, then delete all files on drive B.

9 The DOS system environment is a specific memory area. This memory area is called the Master Environment Block (Master Environment Block), which is reserved to store variables and variable values in the form of string information. Unless modified by a user program or batch file, its data will not change. ---- The Comspec command is to tell the DOS system where to find the Command.com command file when it needs to reload the command processor after exiting a memory-occupying program.
Each program runs only under a copy of the system environment. The program can read the system environment variables and modify them, but once the program ends, any modifications are lost, and the original main environment block still retains the unmodified system variable values. (Of course, it's pre-defined by the system)


10 Configuration commands in Config.sys:

Break Buffers country device drivparm fcbs files lastdrive shell stacks

---country:
counry=xxxfilename]]
Among them, xxx is the country code in the telephone system, yyy is the code page of the country, and filename is the file containing the country information.
If the country is not specifically specified with the country command, the system will use the United States as the default value. In addition, if the file name is not specified, the system will use the country.sys file as the file containing the country information.

---shell:
Sometimes the system programmer writes his own command processor instead of using the DOS file Command.com. At this time, the Shell command must be used to specifically specify the path name of the command processor. In this way, the DOS system will start the command processor specified by Filename instead of executing the standard command processor.
The DOS system sets the Comspec environment variable to the drive, path and file name specified in the Shell command line, thus rewriting the default value of Comspec, that is, the drive and path name of the command processor originally used to start DOS. When reloading the command processor segment, the operating system will use the Comspec environment setting to find the correct location of the file.

11 Ramdrive.sys is an installable device driver. Using it, a part of the memory can be used as a hard disk. This memory is called a RAM disk or virtual disk. Of course, its speed is much faster than that of a hard disk. When the system is powered off or reset, the information in the RAM disk will be lost.

12 A code page is a table used to define a character set. A character set is a group of characters dedicated to a country or a language, which is translated by the code page table and output through a display or printer. Each code page character set contains 256 characters. For example, it can be the letters, numbers and symbols used in Norway.
If not specified, the DOS system will think that the user wants to use the US character set. To make the system support another country's character set, you should:
1) Set the country code in Config.sys. This code should specify the country where the user works or lives.
2) Load the Country.sys file or other file containing the country-specific information selected by the user.
3) Set the system code page. For most country codes, the DOS system automatically prepares two system code pages and automatically selects a basic code page.
(Most countries use 850 as the backup code page. This code page contains all the characters of most languages in Europe, North America and South America.) "


[ Last edited by Billunique on 2007-4-7 at 03:55 AM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
lxmxn +10 2007-04-06 12:26
Floor 2 Posted 2007-03-28 10:08 ·  中国 山东 济南 移动
钻石会员
★★★★★
Credits 10,046
Posts 3,039
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
Not bad, very practical.
简单就是美
Floor 3 Posted 2007-04-06 12:26 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Good, learned...
Floor 4 Posted 2007-05-16 16:39 ·  中国 江苏 无锡 电信
初级用户
Credits 38
Posts 17
Joined 2006-12-19 06:10
19-year member
UID 73933
Gender Male
Status Offline
I've been working hard to learn this these days.
Floor 5 Posted 2007-05-17 10:34 ·  中国 浙江 杭州 华数宽带
初级用户
Credits 73
Posts 39
Joined 2007-05-17 08:59
19-year member
UID 88782
Gender Male
Status Offline
Floor 6 Posted 2007-10-06 01:23 ·  中国 陕西 西安 电信
初级用户
Credits 53
Posts 26
Joined 2007-10-06 00:17
18-year member
UID 98988
Gender Male
Status Offline
Not bad, learned...
Floor 7 Posted 2007-10-06 10:10 ·  中国 北京 大兴区 联通
初级用户
Credits 72
Posts 32
Joined 2007-10-01 16:39
18-year member
UID 98709
Gender Male
Status Offline
Are there any books that provide detailed introductions to AUTOECEC.BAT and config.sys?
Floor 8 Posted 2007-10-06 16:05 ·  中国 贵州 贵阳 电信
中级用户
★★
Credits 304
Posts 117
Joined 2006-04-04 18:43
20-year member
UID 53325
Gender Male
Status Offline
Bookmarked
Floor 9 Posted 2008-09-08 07:27 ·  中国 广东 深圳 电信
初级用户
Credits 30
Posts 17
Joined 2006-08-02 14:48
19-year member
UID 59680
Gender Male
Status Offline
Floor 10 Posted 2009-03-07 01:46 ·  中国 福建 龙岩 电信
新手上路
Credits 25
Posts 13
Joined 2009-03-06 02:19
17-year member
UID 140752
Gender Male
From 福建
Status Offline
It feels good!
Floor 11 Posted 2009-04-09 22:45 ·  中国 重庆 巴南区 电信
初级用户
Credits 20
Posts 11
Joined 2009-01-01 12:28
17-year member
UID 135501
Gender Male
Status Offline
Let me take a look
Forum Jump: