|
Billunique
中级用户
   菜鸟总动员
积分 259
发帖 112
注册 2006-8-28
状态 离线
|
 『楼 主』:
《DOS操作系统3.3及其应用》摘记
使用 LLM 解释/回答一下
@Echo off
Title 《DOS操作系统3.3以其应用》 ——谢德煌等编著 宇航出版社
:: 近几天从图书馆借的一本书,没啥精彩内容,针对个人情况摘了这么些东西,
:: 算是对自己这些天学习的一个简单记录,仅供菜鸟参考,老鸟勿笑!
Echo “
1 Copy的几种用法:
1) copy *.txt+*.rtf *.doc 每一个满足*.txt的文件都相应地与和它同名的*.rtf文件组合起来,结果存放到一个与它们同名但扩展名为.doc的文件中。
2) copy *.txt+*.rtf combin.doc 会把所有的.txt和.rft文件都整合到combin.doc文件中。
3) copy a.txt+*.txt 会把除a.txt以外的所有*.txt追加到a.txt上。(若其后不跟目标路径,copy命令默认将源拷贝到当前路径。copy命令会将源的文件名同目标的文件名进行比较,若重名就跳过一个输入文件。用copy让两个文件叠加时,若目标不明确命名,则目标启用源首文件名)
2 一个批处理命令可以递归调用自己,但是必须在该文件最后含有一个结束条件。
3 在标号label中可以含有空格符,但却不能有其他的分隔符,如;或=。
4 没有向后移动的Shift命令。一旦执行了它,就不能恢复原来的参数位置。(不可逆)
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
(不管后面输入多少个参数,通过“换档”,就全部被处理了)
5 ANSI.sys是用于替换已建立在操作系统和计算机BIOS中的缺少屏幕和键盘格式的驱动程序。ANSI.sys的功能是从键盘上截获字符,并且,或是不加变化地把这些字符传送给DOS系统,或是提供新的重定义字符或字符串。同时,ANSI.sys驱动程序也能控制显示性能,其中包括屏幕颜色、光标位置和系统提示信息。
6 在处理临时性的批处理文件时,通常可以在该文件的最后一个命令行上加上:Erase %0
7 在IF语句中,除了用引号表示参数外,还可以用句点(.)或小写字母x来表示。如if .%1==. goto help。(其实这点可以扩展,也可以用别的任意符号来替代。关键是看是不是符合判断条件。添加这些东西只是添加些陪衬罢了。不过效果应与""等效,就看你喜欢了。)
8 在For中,集合set也可以是一组命令的集合,例如:for %%a in (copy del) do %%a B:\*.* A:\ 将B盘(根目录)下所有文件拷贝到A盘后,删除B盘上所有文件。
9 DOS系统环境是一个特定的内存区域,这一内存区域称为主文件块(Master Environment Block),它是留出来以字符串信息形式存储变量和变量值的。除非已由用户程序或批处理文件修改过,否则其数据不会改变。----Comspec命令是在退出一个占用内存的程序之后需要重新装入命令处理程序时,告诉DOS系统在何处找Command.com命令文件。
每个程序只是在系统环境的一个副本下运行。程序虽然能够读系统环境变量,并对其进行修改,但是,一旦该程序运行结束,所做的任何修改就丢失了,原有的主环境块保留的仍然是未修改过的系统变量值。(当然是系统预定义的)
10 Config.sys里的配置命令:
Break Buffers country device drivparm fcbs files lastdrive shell stacks
---country:
counry=xxxfilename]]
其中,xxx是电话系统中国别的编码,yyy是该国家的代码页,filename是包含该国家信息的文件。
如果没有用country命令特别指定国别,系统将采用美国作为缺省值。此外,如果没有指定文件名,系统将采用country.sys文件作为包含国家信息的文件。
---shell:
有时系统程序设计员自己编写命令处理程序,而不是使用DOS文件Command.com,此时,必须使用Shell命令特别指定命令处理程序的路径名,这样,DOS系统会启动由Filename指定的命令处理程序,而不去执行标准命令处理程序。
DOS系统将Comspec环境变量设置为Shell命令行所指定的驱动器、路径和文件名,从而改写Comspec的缺省值,即最初用于启动DOS的命令处理程序的驱动器和路径名。在重新装入命令处理程序段时,操作系统将利用Comspec环境设置查找文件的正确位置。
11 Ramdrive.sys是一个可安装的设备驱动程序,使用它可以把一部分内存当作硬盘使用,这个内存称为RAM盘或虚拟盘。当然,它的速度要比硬盘快得多。当系统去电或复位时,RAM盘中的信息将会丢失。
12 代码页是一个用于定义字符集的表。一个字符集是某国家专用或某语言专用的一组字符,它由代码页表翻译,并通过显示器或打印机输出。每个代码页字符集包含256个字符,例如,它可以是挪威使用的字母、数字和符号。
如果没有指定,DOS系统将认为用户希望使用美国字符集。为使系统支持另外一个国家的字符集,则应:
1) 在Config.sys里设置国别码,这个代码应指定用户工作或生活的国家。
2) 装入Country.sys文件或其他包含用户选择的国家专用信息的文件。
3) 设置系统代码页。对于大多数国别码,DOS系统自动准备两个系统代码页,并自动选择一个基本代码页。
(大多数国家都把850作为备用代码页。该代码页包含了欧洲、北美和南美大多数语言的全部字符。) ”
Last edited by Billunique on 2007-4-7 at 03:55 AM ]
@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 ]
此帖被 +10 点积分 点击查看详情 评分人:【 lxmxn 】 | 分数: +10 | 时间:2007-4-6 12:26 |
|
|
|
2007-3-28 04:03 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
|
2007-3-28 10:08 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
|
2007-4-6 12:26 |
|
|
wentaowen
初级用户
 
积分 38
发帖 17
注册 2006-12-19
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
这段时间我正在使劲学习这个来着.
I've been working hard to learn this these days.
|
|
2007-5-16 16:39 |
|
|
joinhoone
初级用户
 
积分 73
发帖 39
注册 2007-5-17
状态 离线
|
|
2007-5-17 10:34 |
|
|
huijia0805
初级用户
 
积分 53
发帖 26
注册 2007-10-6
状态 离线
|
|
2007-10-6 01:23 |
|
|
nayn
初级用户
 
积分 72
发帖 32
注册 2007-10-1
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
有详细介绍AUTOECEC.BAT和config.sys方面的书吗?
Are there any books that provide detailed introductions to AUTOECEC.BAT and config.sys?
|
|
2007-10-6 10:10 |
|
|
wydos
中级用户
  
积分 304
发帖 117
注册 2006-4-4
状态 离线
|
|
2007-10-6 16:05 |
|
|
sword221
初级用户
 
积分 30
发帖 17
注册 2006-8-2
状态 离线
|
|
2008-9-8 07:27 |
|
|
Numberone
新手上路

积分 25
发帖 13
注册 2009-3-6 来自 福建
状态 离线
|
|
2009-3-7 01:46 |
|
|
qjfke
初级用户
 
积分 20
发帖 11
注册 2009-1-1
状态 离线
|
|
2009-4-9 22:45 |
|