@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:
(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 ]
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
| Rater | Score | Time |
|---|---|---|
| lxmxn | +10 | 2007-04-06 12:26 |
