Supplement of DOS Basic Knowledge (Memory Key)

xiaoxiao2021-03-06  36

Supplement of DOS Basics

DOS6.22's memory management command is more embarrassed

First, three ways of use in the expansion

In the first way, some of the original way, some of the prematured software, such as Supper CCDOS5.21, such as Supper CCDOS5.21, is used in this way (Jinshan Chinese characters will automatically transfer the Chinese word library to the road extension memory) so-called Original way, you can also call "barbarism" method, in this way, each software has its own set of extended memory methods, mutual ventilation is also incompatible, resulting in creating only one software Extend memory, otherwise a program will have another program to rush down this mutually "fight" in extended memory. We can use this uniform specification with the extension memory used by "barbarism" as "non-type memory" or called "wild memory."

After 1984, in response to this phenomenon, the chaotic situation of the expansion memory usage is resolved, and the international compute intermediate industry has launched two specifications that use extended memory, which are XMS specifications and EMS specifications. These two specifications are all software using extended memory using extended memory, unified and standardized the way to expand memory access. Each application uses expansion memory to follow these two specification provisions to access extended memory, the application is no longer accessible to extending memory directly, but through the XMS or EMS specification to access the expansion memory access, Due to XMS or EMS specification management and scheduling access to extended memory, it can fundamentally avoid the mutual playing phenomenon that can be caused by "barbarism" ways to access the expansion memory. In both XMS and EMS specification, the Tune XMS specification is a more advanced viewing. At present, most of the newly designed software such as Windows, Office, etc. are basically followed XMS specification (using EMS specification access to extended memory) The software is currently very few).

We refer to the "XMS type memory" or referred to as XMS memory, or referred to as XMS memory, and refer to the EMS type memory or referred to as EMS memory. These two specifications are not the same as extended memory.

The XMS uses extended memory by excreting data in the extended memory to regular memory, the user program still goes to the regular memory, and then the XMS specification driver himem.sys is responsible for converting it to extended memory Access.

EMS is to exchange data in the extended memory to the idle address in the upper inlet. That is, in the upper memory block (UMB), the extension memory is used, and the specifically designed user program is transferred to the UMB, and then the driver EMM386 specified by the EMS specification. EXE is responsible for accessing its conversion to extend memory. Since the EMS memory is mapped by the extended memory to the UMB, this is equivalent to a page window opened in the upper memory, and the user program uses the extended memory by this window one page, so people also call the EMS memory. RAM.

The above two types of expansion memory can be shown below:

Himem.sys

User program ← one by one ... one → conventional memory → ... 1 ... One → Extended memory

(XMS specification)

Emm386.exe

User program ← one one ... one one → Super memory block → ... one ... one → extend memory

(EMS specification)

Second, the role of the device driver HIMEM.SYS

Usage: Device = [Drive] [Path] Himem.sys

Himem.sys has two:

The first is to convert 1M unmatis-free memory into memory that meets the XMS specification, that is, open XMS memory for use in programs that need to use XMS memory.

The second is to draw the first 64K memory block from the XMS memory, which is opened from the XMS memory, so that the DOS = high command can save the DOS part core from the residential area to save More regular memory is used by user programs.

Since many softwares to be running must use the XMS memory opened by Himem.sys, it is obvious that himem.sys should run before all the programs that use XMS memory. In addition, HMA is also open from Himem.sys, so only the functionality of DOS = HIGH is only running hiMem.sys.

Third, the role of dos = high command

The functionality of the DOS = high command is to move the DOS section to the HMA from the DOS resident area to save more regular memory for user programs.

Only DOS 6.22 has only DOS core energy to be moved to HMA, the device driver and the resident program can only be moved to the UMB.

Because HMA is opened by Himem.sys, if only DOS = HIGH is run, as long as Himem.sys support is enough, it is not necessary to run EMM386. EXE.

four. The role of device driver EMM386.exe and its key parameters

Usage: Device = [Drive] [Path] Emm386.exe [noems] [RAM]

1. Emm386.exe

Two the role of Emm386.exe:

First, part of the XMS memory opened from Himem.sys is converted to the memory that meets the EMS specification, mapped to the EMS page box (EMS window) in the last memory area, that is, open an EMS memory, or called XMS Memory comes to simulate EMS memory for use in programs that need to use EMS memory.

Second, part of the XMS memory opened from HIMFM.sys, mapped to the upper memory block, that is, open up the upper memory block, so that the DOS = UMB command will make DOS to use the upper memory block.

From this we see that EMS memory and UMB are "borrowed" from the XMS, while XMS is Himem. Sys open, so emm386.exe is supported by Himem.sys programs.

Since UMB is made from EMM386. Exe is open, so only after running Emm386.exe. The functionality of DOS = UMB can be implemented.

2. Parameters of EMM386.EXE

The parameters when running EMM386.exe are important, the main operation parameters are as follows:

(1) If EMM386.exe is run without any parameters, only EMS memory is provided without UMB.

(2) Run the EMM386 if the parameter eoems is run. EXE, only UMB is provided without EMS.

(3) If the parameter RAM is running EMM86. EXE, both EMS memory and UMB are provided.

Most of the test questions require that when writing the config.sys file, you have to adjust some programs to the UMB, so we must write the parameter NOEMS or RAM after writing the Emm386.exe command, that is, it should be written as Device = EMM386. EXE RAM or DEVICE = EMM386.EXE NOEMS can be. Many students are only written into device = emm386.exf, and there should be no parameters later. At this time, UMB will not come,

Usage example:

[Example 1] Device = C: /DOS/emm386.exe (EMS memory only)

[Example 2] Device = C: /DOS/EMM386.EXE NOEMS (UMB only)

[Example 3] Device = C: /DOS/emm386.exe ram (simultaneous EMS Memory and UMB) Five, DOS = UMB Command

The function of the DOS = UMB command is to let DOS put by EMM3S6. The UMB opened by EXE is connected with regular memory, that is, let DOS use UMB to use, so it is possible to use DeviceHigh or LoadHigh command to transfer device drivers or residence programs from regular memory from regular memory to UMB, Save more regular memory for user programs.

Because the UMB is opened by Emm386.exe, if you want to run the DOS = UMB, you must first run Emm386.exe.

In addition, DOS = UMB simply notifying DOS to use UMB, but do not transfer any programs into the UMB, to specifically send a program into the UMB, need to run the deviceHigh or loadHigh command.

Also, if only the EMM386 is written. Exe, without writing DOS = UMB, the UMB opened by Emm386.exe does not use it. At this time, DOS does not use UMB, of course, it is more unable to implement devicehigh or loadHigh command, so it must Don't forget the sentence of DOS = UMB.

Through the above analysis, it is known that DOS = High and DOS = UMB these two commands are not necessarily related, one is related to HMA, one is related to UMB, in config.sys, will also appear at the same time.

Sixth, DeviceHigh and loadHigh command role

When writing a DOS = UMB command in config.sys, DOS can use the UMB to use it, we can store some programs to the UMB. But not all the program unit can put it in the UMB. Procedures that can be placed in UMB have only two types, and one is a device driver, and the other is a resident program.

1. Load the device driver with deviceHigh = command

Usage: dfvicehigh = [Disk [[Path] device driver name

The device driver refers to programs that are used to drive and manage hardware devices. For example, Himem.sys is a program for driving and managing extended memory, and like mouse.sys is a drive mouse. program.

The device driver can only be written in config.sys as "device = device driver name", and the device driver is executed when the DOS is started to be executed and permanently before executing in Command.com and AutoExec.bat. Load memory. In addition to individual, most of the device drivers cannot run at the DOS prompt. The extension of the extension of the equipment driver is .SYS, only a few of the exceptions such as EMM386.exe.

If you use the "Decive =" command to load the device driver, the device driver will be loaded into regular memory. If you want to put the device driver into the upper memory, you must use the "DFVICFHICTH =" command. In fact, in DOS6.22, the devicehigh command has been fully replaced by the device command. All local parts written by Device can be replaced with DeviceHigh, and the DOS will automatically put it in the regular memory. Will not go wrong. Despite this, we still recommend that students use the two commands to be used according to the situation during the exam.

2. Run a resident program with the "LoadHigh" command

Usage: LoadHigh [Drive] [Path] Resident Program Name

Or LH [Drive] [Path] Perform Program

The program executed at the DOS prompt, after which it is running, it usually releases all memory spaces you occupy to supply the procedure to be run. But there is a class of procedures, but this kind of program is a resident program. The resident program is also called a resident memory program, TSR program, or a resident program that means that once permanently occupying memory (these programs are never staying in memory). After the program is resident in memory, there is a chance to work, monitor and control the work of the user at any time. For example, viruses are typical resident programs, which are all required to run the Chinese character operating system, such as spiib.com, spdos.com, py.com, mouse manager mouse..Com, etc. is a resident program. Smartdrv.exe, doskey.com, vsafe.com, etc. in DOS6.22 is also a resident program. Both the resident program must run at the DOS prompt, cannot be written in Config.sys. So it is a normal way to determine a program is a device driver or a resident program: if it must be written in config.sys, it is a device driver; if it can only be run on the DOS prompt, it is a resident program. (Of course, it is not all of the resident programs that can be run on the DOS prompt.

If you don't write loadHigh when running a resident program, such as mouse, the resident station will reside in regular memory, if you want to transfer the resident program to the UMB, you must write to Loadhigh in front of the command (Note: LoadHigh A shorthand is LH), for example: loadinghightmouse.com. Then mouse.com is placed in the UMB.

Pay special attention to the use of these two commands: The device driver can only use the devicehigh = command, the resident memory can only be used with the "LH" command (or "LH" command), and the waith must be written in front, etc., The LoadHigh is never written, and it can be separated from a space with a space.

Seven, disk high speed buffer smartdrv.exe role and usage

DOS6 .. 22 There is a very useful resident program SmartDrv.exe, using it to greatly speed up the disk's read and write speed. The principle of its work is as follows:

Since the disk (including the hard disk) is slower than the memory. To this end, smartdrv.exe has an area (called high speed buffer) as a block between the host and the disk, which is used to temporarily store data read from the disk. In this way, when the disk is read next time, the first smartdrv.exe looks for whether the data to be read can be found in this buffer. If you can find it without reading the disk, you can directly put the data from the buffer directly. Take it back, this can greatly save the time of reading the disk. Of course, if you can't find it in the buffer, there is no way, you have to read the disk. So this has a concept that can be found in the buffer, the concept of hitting rate, obviously repeatedly read the data hit rate. Similarly, SmartDrv.exe can also perform caches to write a disk. When writing a disk, the host can return to do other things immediately, when the data is written to the buffer, when the CUP is idle, then SMARTDRV.EXE is secretly written to the disk, so that the write disk speed can be greatly accelerated.

Since smartdrv.exe can only use XMS memory, you must run the Himem.sys program in the config.sys file in advance to open an XMS memory for smartdrv.exe as a high-speed buffer .. Note that SmartDrv.exe is a resident program, which is usually written in AutoExec..bes or runs separately on the DOS prompt, generally not written in the config.sys file, only written in autoexec.bat or in the DOS prompt Under operation, you can start a buffer. In addition, smartdrv.exe is very special, even if we do not take loadinghigh, it will automatically put itself into the UMS, (we said the smartdrv.exe program itself will automatically enter In the UMB, the high-speed buffer opened by SmartDrv.exe is still in XMS memory, that is, the extension memory), and other resident programs must be written to the UMB.

The main usage of the smartdrv.exe program is as follows:

[Panline] [Path] Smartdrv.exe [initial value] [Minimum of Windows runtime] [l]

among them:

The initial value (unit is KM one by one refers to how much XMS memory is used as the disk cache, the greater the better, but if it exceeds 2m, the increase is not obvious. If no maximum is given, smartdrv. EXE automatically selects a suitable value automatically on the size of the XMS memory.

The minimum of Windows runtime (in KB) is only possible to use this parameter when running Windows. Because Windows should use XMS memory in large quantities. When the XMS memory is tense, Windows automatically reduces the size of the high-speed buffer used by SmartDrv.exe to first meet your requirements for XMS. The minimum is specified, that is, a limit for Windows, when the cushioning is reduced to this minimum, it is not allowed to seize the high-speed buffer area used by SmartDrv.exe.

/ L --- Forced to put smartdrv.exe into constant memory (if not written, smartdrv.exe automatically install yourself to UMB)

Usage example:

[Example 1] C: / DOS / Smartdrv.exe (Automatically select the appropriate high-speed buffer size)

[Example 2] C: / DOS / SmartDrv.exe 1024 502 (The initial value is 1024K, the minimum value of the Windows line is 512K)

Eight, establish the role and usage of device drivers of RAM disk Ramdrive.sys

Ramdrive.sys The role of Ramdrive.SYS is to establish a RAM disk with a very fast access speed with a part of the system.

The general usage is as follows:

Device = [Drive] [Path] Ramdrive.sys [RAM disk capacity] [/ e] [/ a]

among them.

RAM disk capacity (unit is KB) How much memory is used to establish a RAM disk, and the default value is 64K.

/ E uses XMS memory to establish a RAM disk. You should run Himem.sys in advance will have XMS memory.

/ A uses EMS memory to establish a RAM disk. You should run Himem.sys and Emm386.exe in advance, there will be EMS memory.

If / e or / a is not written, the RAM disk is created by default.

Usage example:

[Example 1] DeviceHigh = ramdrive.sys (use regular memory, size 64K)

[Example 2] DeviceHigh = ramdrive.sys 1024 / e (using XMS memory, 1M)

[Example 3] DeviceHigh = ramdrive.sys 2048 / A (using EMS memory, size 2m) Nine, interdependence of each memory management command

By facing the meticulous analysis of the commonly used memory management program, it can be seen that there is a pre-sequential problem between these commands, and the interrelationships between them are as previously described.

When writing config.sys files, the heart should write himem.sys first, then write EMM386.exe, and finally the deviceHigh command, but DOS = high, dos = umb and other commands can be written in any position.

Simple settings for extending memory

1. Put DOS into high-level memory (HMA), where the location is entered in the Config.sys file in the Config.sys file in the 64K area of ​​more than 1 megabyte. Put the driver to high-end memory (upper memory), where there is a 640K to 1M (system unused zone) Enter Device = EMM386.EXE RAM (Noems) DOS = UMB 3 in config.sys. Use DeviceHigh = Device to driver program format, use high-end memory: device = himem.sys device = emm386.exe ram (noems) dos = high, umb devicehigh = ansi.sys ten, multiple profile preparation and common errors

1. General structure of config.sys files when multiple configuration

[Menu]

Menuitem Configuration Block Name 1, the corresponding menu display text

Menuitem Configuration Block Name 2, the corresponding menu display text

......

MenuColor menu text color, screen background color (this trip is generally not written)

Menudefault defaults block name, waiting for the number of seconds (this line can be omitted)

[Common "

Public configuration command

[Configuration Block Name 1]

Configure block 1

[Configuration Block 2]

Configure block 2

Eleven, common mistakes for config.sys files when multiple configuration

(1) The configuration block name must not contain spaces, and the menu display text can contain spaces but must not be generated with quotation marks.

(2) Menu Display Text can be omitted, if omitted, will display text as the default menu as the default menu.

(3) When the runtime menu shows the content in the text, it is displayed on the screen, so pay attention to the menu display.

Text must be consistent with the case required for the examination questions. If the menu text is omitted, since the configuration block name is displayed as the default menu display text on the screen, you must note that the configuration block name written in the MenuItem is equal to the case requested by the test volume.

(4) Although the mfnudefault command has not been tested, the command is very useful and should be mastered. If you have a MenudeFault, if the user does not press the user in the specified time, the specified default configuration will be automatically executed; if not writtenfaui1, wait for the user button to select a configuration.

(5) The configuration block is consistent before and after, but the case is not necessarily distinguished.

(6) The writing order of the configuration block is not required, but the habit will be written to the front. The same name (including public blocks) can be plural, and all the same name blocks are performed in order.

(7) In multiple profiles, any configuration command must be included in a configuration block, which is not allowed to have a configuration command that does not belong to any configuration block. (8) If no public configuration command is included in the public block, [Common] is kept or deleted.

(9) Even if each configuration block listed in Menuitem, there must be a [Configuration Block Name] corresponding to it later, even if the content in a certain configuration block is empty, it must be written One line [Configuration Block Name] must not be omitted, otherwise the error will not be found in the future. This is the most easy to make mistakes.

(10) Be sure to strictly divide which commands should be written in config.sys, which commands should be written in AutoExec.bat. Equipment drivers should be written in Config.sys, while the DOS internal commands and external commands should be written in Autoec.bat.

Twelve, the general structure of the autoexec.bat file when multiple configuration

Public execution command

Goto% config%

: Configure the block name 1

Configuration block: command to be executed

Goto end label name

: Configure the block name 2

Configuring block 2 command to be executed

Goto end label name

: End Name

Thirteen, the common mistakes of the autoexec.bat file when multiple configuration

(1) In the multiple configured autoexec.bat file, the most important command is goto% config%, "config" must be clamped with two percent sign and cannot contain any spaces in the middle. In DOS, the meaning of "% environment variable name%" usage is the value of the specified environment variable. At multiple configurations, config is a reserved environment variable name inside the DOS, which represents the name of the configuration block selected in the menu defined by the user. For example, if the user corresponding to the menu item selected in the menu is Windows, the value of% config% is Windows. At this time, goto% config% is equivalent to GOTO Windows, which can be flexible according to previous The menu is selected to transfer to the corresponding label. You must never write this sentence into "goto config" or write "goto config.sys".

(2) In Config. Each configuration block defined in the SYS file is in AutoExec. There must be corresponding labels ": Configuration Block Name" in BAT. Even if there is no command in the contents of a label, you must write a line ": Configure Block Name", you must issue any reference numerals. This is also one of the most easy to make mistakes.

(3) Use the ": Configure Block Name" statement to define the label that must be consistent with the corresponding configuration block previously defined in config.sys, but cases do not have to distinguish. In addition, the habits will be defined as end.

(4) Each of the labeling statements should be added with the "GOTO end label name" statement, and use the ": End Number name" statement to define the end label, indicating that the command in this configuration is skipped. Configure the corresponding command.

(5) If there is no public order, the first command is goto% config%.

(6) If the above is written, it is first to execute the common command, and then execute the command in the corresponding configuration block. Sometimes, you may want to execute the command in the configuration block, and finally write public commands at the end of the ": End Number" statement, will start writing public orders. Five, a minimum multi-configuration file instance

Multiple configuration questions in the practice questions of the disc, please students combine the above-mentioned points, and analyze these test questions, limited to space here, we will no longer have examples.

A multi-configuration instance listed below, only one configuration selection menu is started (two configuration names are DOS and Windows), but no matter which command is selected. This example does not have any practical significance, our purpose is to emphasize a question through this example: Even if there is no content in a configuration block, any configuration block definition statement (ie "[," [configuration block name "in the config.sys file ] ") And autoexec.bat

No one of the files (ie, ": Configuration Block Name") cannot be omitted, otherwise it will be wrong when running.

(1) Config, SYS file content:

[Menu]

Menuitem = DOS

Menuitem = Windows

[Common] (this line can be omitted, but it is best not to save)

DOS "

[Windows]

(2) Autoexec.bat file content:

Goto% config%

: Do5

Goto end

: Windows

Goto end

: END: END

14, current disk and current catalog

When the current disk refers to, which disk is currently located, the current directory refers to which directory currently on the disk, generally, the DOS prompt will tell us where the current directory is currently the current directory. For example, if the prompt displayed on the screen is C: \Windows>, it is now located in C: \Windows>. If you want to change the current disk, simply enter the drive letter and enter the car, you can switch to eight discs, the screen prompt is automatically changed to A>; if you want to change the directory, you must use it below. CD command.

Fifteen, file identifier

Three-element (called file identifiers), "file identifier)," file identifier), "Decoction," During actual use, for use, especially pay special attention to the following Use principle:

(1) If the traver path is default, the current directory of the current disk is referred to by default.

Example: C: / Windows> DIR *. * ↓

Explanation: Displays all files (ie, C: / Windows subdirectory) in the current directory of the current disk.

(2) If the strip is default, the current disk is referred to by default.

Example: C: / Windows> DIR /DOS/*.*

Explanation: Displays all files in the current disk specified directory (ie, C: / DOS subdirectory).

(3) If the path is default, the current directory is referred to by default.

Example: C: / Windows> DIR A: *. * ↓

Explanation: Displays all the files in the current directory of the specified disk (ie the current directory of the A disk, not necessarily a disk root directory).

(4) If the file name is default, the different commands have different interpretations (most of the occasions represent all files. Equivalent to *. *, But also exception).

Example: C: / Windows> DIR ↓

Solo: Displays all files in the current directory (ie, C: / Windows subdirectories, equivalent to omitting *. *). XVI, absolute path and relative path

If the file identifier of a file is a complete path counting from the root directory, it is called an absolute path. Conversely, if the path is counted from the current directory, it is called a relative path. If a beginner is unclear, use the absolute path to grasp a larger, but it is more cumbersome. It is more written to write a relative path.

Example: C: / DOS> DIR C: / Windows / System /*.*

Explanation: This example uses the absolute path, the file location is not explicitly given its full path from the C: plate root directory.

Example: C: / DOS> DIR Windows / System /*.*

Explanation: This example is used as a relative road. Its meaning is that all files of the system subdirectory of the Windows subdirectory under the current disk current directory C: / DOS> are displayed. This is quite equal to the following command, C: / DOS> DIR C: / DOS / Windows / System /*.*

Pay special attention to the distinction when using, the general principle is that if it is used in the current directory or the content in the current directory, the relative path is used to use; if it is used using the contents of the current directory (or more) directory, then It is more appropriate to use absolute paths.

Seventeen, internal commands and external orders

The DOS command is divided into two categories: DOS internal command and DOS external command. Any command (including internal and external commands) executed in the DOS prompt is performed by the command handler Command.com. Any system disk that can be used to start DOS must contain three system files IO.SYS, MSDOS. Sys, and command.com with DOS. Command handler Command.com is loading the memory by the disk boot program when the machine is started, and the program is internally stationed.

The execution code unit of all DOS internal commands is included in the Command.co M program. We know, any program must be executed, you must first enter the memory. Now since the Command.com program used by the internal command has entered memory when the machine starts, so it can be used directly after the internal command machine starts successfully, the internal command execution We must never specify the disk or path for it. In addition, since the internal command can find the corresponding execution code in the memory, it is not possible to temporarily put the corresponding executable to the memory as an external command, so the execution speed of the internal command is very fast.

The internal commands are some common commands, but they are subject to basic memory capacity, and the command.com program cannot be done very much, so that there is still some commands that cannot be included there. These commands can only be stored on disk in the form of program files, and their extensions exe and COM can be extended. When using, the user calls the corresponding program through its file name, which cannot be used directly after the machine is started, and all are stored on the outside, so you are an external command. The DOS external command is called the DOS external command with exe and disk file part of COM.

After the internal command is successful after the machine starts successfully, the internal command is performed, so that the internal command does not need to specify the drive letter path. However, when executing external commands, the location of the external command is usually given, that is, in front of its program name, it is forwarded to find it on the disk when the DOS is executed, and the memory is adjusted. This is an important difference between external commands and internal commands in the method of use. Since the external command is more than one process from the internal command, the execution speed is slower. However, it should be noted that when the external command is performed in the following cases, it is not necessary to give the discravel path. First, the external command is in the current directory of the current disk, and the other is the search for the external life in advance. path.

Eighteen, some common DOS internal orders

1. Copy command

Usage: COPY [Target File Identifier] Role: Copy file, connection file, create files, and output files.

For example:, C: / DOS> Copy Himem. Sys Hiniem2. SYS ↓

When using, wildcards are used in the source file name and the target file name to copy a batch of files.

(1) Copy file

1 The same name replication If the target file name is the same name with the source file name, the target file name is available.

Example :: C: / DOS> Copy Himem.sys C: / Windows ↓

Role: Copy the current disk current directory C: / DOS to the c: / windows directory, the file name is unchanged (here you assume that there is a lower subdirectory Windows in advance.

Example :: C: / DOS> Copy /*.sys C: / Windows ↓

Role: Copy all the .sys in the C-plate root directory to the C: / Windows directory, the file name is constant.

2 renovation copy

The COPY command can be renamed while copying, when the target file name is different from the source file name, the file name of the target file must be listed.

Example :: C: / DOS> Copy Himem.sys C: /Windows/Himem2.sys

Explanation: Copy the Himem.sys file to the C: / Windows directory and renamed it is Himem2.sys.

Example: C: / DOS> Copy * .txt C: / Windows / *. Dat ↓

Explanation: Copy all files to the extension of TXT to the C: / Windows directory and change the replicated file extension to DAT.

3 The entire target file name is default

When the file identifier of the entire target file is fully available, it means to copy the source file to the current directory, and the target file name is the same name of the source file name.

Example: C: / Windowss> Copy C: / Windows / *. SYS ↓

Explanation: Copy all the files in the C: / Windows directory to the current directory Windows of the current dish in the current disk.

Note: If copying to the target with the same name with the source file, DOS will prompt the following: OverWrite XXXXXXX.XXX YES / NO / ALL? This is to ask the user whether the user wants to overwrite the same name file, the user answers Y and carries back to overwrite the file; answer N and enter the carriage return to indicate that the file is not covered; answer A and carriage return indicate not only cover the file, but also During this copy, all the same name files after this file are overwritten, and no longer prompted.

(2) file connection

Usage: COPY (File Identifier 1) [File Identifier 2] Ten [...] [New File Name]

Use the plus number to connect multiple text files, merge into a new file.

The text file refers to a file that does not contain any special control symbols, only a file containing pure text information. For example, the files established with DOS's COPY CON, EDIT, and Windows NotePad are text files. Note that there is no meaning to connect to the executable file.

Example: C: /> Copy C: /DOS/l1.txt c: /dos/l2.txt c: /dos/l3.txt

If the new file name default, it indicates that the first file name is used as a new file name.

(3) Establish a text file

Use DOS's retention file name (also known as reservation device name) CON:, you can generate a new text file on the keyboard. Contemporary the keyboard as an input device, represents the screen as an output device interpretation. Example: C: /> Copy Con: a: /memo.dat

Explanation: After the command is executed, we can enter multiple lines on the keyboard. After entering the F6 key or CRTL Z key, then enter the Enter, you can create a new file Memo.dat in the A disk root directory.

(4) Output data file

Output data files from the screen or printer.

Example: C: / DOS> CPPY C / Config.sys PRN: ↓

Explanation: Print file content on the printer. Among them, DOS reserved device name PRN: represents the printer, it can be understood that copying files to the printer (Note: PRN and CON's colon can be omitted).

Example: C: / DOS> Copy C: /Config.sys Con

Explanation: Display file content on the screen.

2. DEL command (or ERASE command)

Usage: Del [file identifier]

Role: Delete the specified one or a batch of files (this command cannot be used to delete the directory), and wildcard characters are allowed in the file name.

Example: C: /> DEL C: /DOS/OS2.TXT

To: c: / temp / del *. * ↓ (Be careful when deleting all files in the specified directory)

3. Ren command (or rename command)

Usage: REN [Source File Identifier] [New File Identifier]

Role: Change the source file name to a new file name. A wildcard is allowed in the file name, ie, a batch of files is allowed to be renamed.

Example: c: / dos> Ren Readme.txt Help.doc ↓

Example: C: / DOS> REN * .TXT * .DOC ↓

Explanation: All extensions of all files in the C: / DOS directory are changed to DOC, and the file name is unchanged.

Note: (1) The drive letterpread can appear in the source file name, but the drive letter path is absolutely not allowed in the new file name. Because the new files after the rename can only be located at the directory path where the source file is located.

(2) The new file name does not allow other files of the directory where the source file is located.

4. TYPE command

Usage: Type [file identifier]

Role: Display all the contents included in the specified file on the screen. Displays the content in the executable file with this command.

Example: C: / DOS> Type Readme.txt ↓

Note: (1) The wildcards are not allowed in the file name? And *, only one file can be displayed at a time.

(2) The file content can be output to the printer or other file by redirecting commands, but the file content will no longer display on the screen. Such as: C: / DOS> Type C: /autoexec.bat> PRN ↓

5. CD command (or chDIR command)

Use: CD [Drive] [Directory]

Role: Change (entry) to the specified directory or display the current directory.

The CD command can only change the directory and cannot change the disk.

There are several special sub-direct inscriptions to note, "." Indicates the current directory, ".." indicates the current directory, "/" represents the root directory.

The CD command has the following four usage:

(1) If only the directory name is given, its role is to change the current directory of the current disk to the specified directory. This is the most important usage of the CD command.

Example: C: / Windows> CD SYSTFM

Display: c: / windows / systfm>

(2) If the discard and directory name are given, the role is to switch the current directory of the specified disk to the specified directory. In this way, the current directory of another disk can be changed without changing the current disc.

Example: C: / Windows> CD A: / WARNING ↓

Change the current directory of the A disk to Warning)

Display: c: / windows>

(Note: The current disk has not changed, so the system prompt has not changed)

Operation: C: / Windows> A: ↓

Display: A: / Warning> (The current directory of the A disk has changed)

(3) If only give the discard, its role is to display the current directory of the specified disk now.

Example: C: \windows> CD A: ↓

Display: A: / (indicating the current directory of the A disk as the root directory)

(4) If no parameters are given, its role is to show what location is now on where the current disk current directory is now.

Example: C: \windows> CD

Display: c: \windows

Indicates that the current directory of the current disk is c: \windows>, as shown in the prompt)

6. md command (or mkdir command)

Usage: MD [Drive:] [New Sub Directory Name]

Role: Establish a designated new subdirectory.

Note: (1) The new subdirectory should pay attention to the subdirectories or files of two identical names in the same directory.

(2) When establishing a multi-stage subdirectory, you must first build a top-level directory, then build the next grade directory, and execute from above.

Example: C: / DOS / MD DOS1 ↓

C: /> MD Work ↓

(3) This command can only establish a subdirectory at a time.

7. RD directory (or rmdir) command

Usage: RD [Disk] [Subdate Name]

Role: Delete the specified subdirectory.

Note: (1) Be sure to ensure that there is no content in this directory when deleting a subdirectory, must be deleted from the bottom up. Obviously, this order is far less convenient as the external command deltree.exe.

(2) You cannot delete the current directory, you must be returned to its superior directory or other directory to be deleted.

(3) This command can only delete a subdirectory at a time.

Example: C: / Work directory has some files and a subdirectory called Worki, requiring deletion of the Work subdirectory.

Operation: C: / del Work /*.*

C: / DEL WORK / WORK1 *. * ↓

C: / rd Work / Work1

C: / rd Work ↓

8. Path command

Usage: Path [Disk:] [Path]; [Disk] [Path] .........

Role: path is used to set the search path of the external command. When the user performs an external command, DOS always looks for the corresponding program file in the current directory. If it is not found, it will automatically press the lookup path order set up to PATH, and sequentially find the program file in these paths. If you find it now, if you do not find the corresponding program file in the path set by the PATH command, the system prompt: BAD Command or FileName (Error Command, File). Once the lookup path is set with PATH, it is very convenient to perform the external commands included in these paths in any subdirectories. Note: (1) The lookup path set by PATH must be separated by a semicolon, and a space cannot be used. Use an absolute path in the lookup path, do not use relative diameter.

(2) The setup path set in PATH has been valid. If you reset the lookup path with PATH, the new lookup path will automatically overwrite the current lookup path.

(3) Delete all the previously set found paths to use the command PATH;

(4) Only when the user executes the program files with exe, COM or BAT to extension, DOS looks for the lookup path set by Path. Path is invalid for the files of the remaining extensions.

(5) The parameter is not used to indicate the current setup path.

Example: Several methods of running an external command attrib in C: / DOS.

[Method 1]: Clearly stratet the drive path where the external command is located.

C: / Windows> C: / DOS / Attrib ↓

[Method 2] Enter the subdirectory and then execute the external command.

C: / windows> CD / DOS ↓

C: DOS> Attrib

[Method 3] First set the lookup path with the path command, contain the subdirectory in the lookup path, so that the external command can be executed directly in any subdirectories.

C: / windows> Path: / dos; c: / windowsc; / ucdos; c: / foxpro25 ↓

C: / attrib ↓

9. CLS command

Usage: CLS

Rexike: Clear all the contents displayed on the screen and position the cursor to the upper left corner of the screen.

19. Common DOS external orders

1. Format command

G / S: Format / U / Q / S

Role: Format the disk in the specified drive, enabling it under DOS, find and identify the broken track, establish and initialize the boot record, file allocation table, and root directory of the disk. All data in formatted disks will be lost, and the new disk can only be used after formatting.

(1) Fast format ratio (parameter / q)

The fault ratio object must be a formatted disk, using parameter / q, it will empty the file allocation table and root directory, but all the contents of the data area on disk remain unchanged, nor check The bad tag on the disk, so the formatted speed is faster. Quickly formatted disks can be recovered with unformat commands, but the fast format ratio is not available to the new disk.

(2) unconditionally formatted (parameter / u)

Unconditional formatting use parameter / u is performed, it will clear all the data in the disk, and check the bad tag, and the formatting speed is slow. Unconditionally formatted does not save the original system area of ​​the disk, so the formatted disk will not be recovered with the unformat command in the format, and the format command that does not use / u can generally be recovered with the unformat command. It is more appropriate to use unconditional formatting for new disk or use a long time. (3) Format and make a system disk (parameter / s)

After using the parameter / s, the system program is copied to the disk and makes it a system disk that can start DOS. The system procedure refers to the following four programs: IO. Sys, msdos. SYS, DRVSPACE. BIN, Command. COM, where the first three programs are system, implied, read-only files.

(4) The above parameters can be used in combination. If you want to format a disk quickly, use the / q parameter combination, the speed of formatting is the fastest, if formatted / q / u parameter is not written, then default Keep the original system area and check the bad tag, the formatted disk can be restored with the unormat command, but the speed of formatting is the slowest.

Example: Format a disk.

Action: C: / DOS / FORMAT A

Example: Format a system disk that can start DOS.

Operation: C: / DOS / FORMAT A / S

Example: The fastest formatted one disk.

Action: C: / DOS / FORMAT A / Q / U

转载请注明原文地址:https://www.9cbs.com/read-61738.html

New Post(0)