Internal command of DOS
The internal command of DOS is the basis of operation. Learn them and you will step into the door of DOS system.
1)dir- Displays information about all files or directories on the specified path.
Its format is "DIR[ drive letter:] [path] [file name] [parameter]", such as "DIR E:\FF". M3U”。 Enter and press enter to display relevant information (as shown in figure 1). In addition, it has several parameters:
/W: widescreen display, where five file names are displayed in one line, but the modification time, file size and other information are not displayed;
/P: Paging display, which can be used when information cannot be displayed on the screen;
/A: Displays files with special attributes, such as "H" hidden, "R" read-only, etc. We can enter "DIR *. * /AH "displays all files with hidden attributes in the current directory;
/S: Displays all files in the current directory and its subdirectories. With this parameter, we can search a file or directory. For example, we can search in "c: >" and enter "DIR *". DAT /S "to find all files with the suffix dat in drive C.
You can use several parameters at the same time, such as "DIR *". COM /W /P /S”。
Figure 1
2)MD- create a directory
The format is "MD[ drive letter] [path]", such as "MD TEMP".
Note: This command can only create one directory at a time.
3)rd- delete directory
The format is RD[ drive letter] [path].
Note: This command can only delete an empty directory, not the current directory.
4)CD- enter the specified directory
The format is "CD[ path]", such as "CD HAPPY".
Note: You can only enter directories in the current drive letter. Where "CD" means to return to the root directory and "CD ..." means to return to the previous directory.
5) Copy-Copy files
The format is "copy [source directory or file] [destination directory or file]", such as "copy C:\*. COM D:\ "We can also type" copy c: \ command.com d: \ command.bak "to copy the file and rename it.
Note: When copying files with this command, the destination directory must exist.
6) Delete files
The format is "DEL[ drive letter] [path] [file name] [parameter]", such as "DEL C:\DATA\*. BAK”。 It has a parameter: "/P", which enables users to display the deletion query of each file when deleting multiple files (as shown in Figure 2).
Figure 2
7) Ren-Rename
The format is "Ren [original name] [current name]". The version of DOS after 7.0 supports modifying file names and directory names, while the previous DOS can only modify file names.
8) Type-Display text file
The format is "Type [file name]", and you can view the text file.
9) Disk copy
[Function] Copy a disk exactly the same as the original disk.
[Format] diskcopy Source Drive Name Destination Drive Name
[Description] Mainly used for backup. For example, our computer will come with some device drivers when it is just bought, which may be used in the future. In order to prevent these disks from being damaged, we must back them up. At this point, it is faster and more convenient to use the diskcopy command.
10) deltree-Delete directory tree
[Format ][c:][ Path] Deltri [c 1:][ Path 1][[C2:][ Path 2] […]]
[Description] This command will destroy the entire specified directory tree, whether it is read-only, hidden or non-hidden. Please use it with special care. This is a dangerous order.
1 1)MEM- Check how much memory your computer has and how it is used.
[Format] Type the mem command directly.
12) chkdsk-Check disk usage.
[format] chkdsk disk name
[Description] For example, to check the usage of disk A, enter chkdsk A:, check the usage of disk C, and enter chkdsk C:. If you enter chkdsk directly, check the current usage of disk.
13) sys-pass the system file command. Transfer two implicit system IO. SYS and MSDOS. The SYS file is copied to a specific location on the target disk, and the COMMAND.COM file is copied. After completion, the target disk becomes the boot disk of DOS.
[format ][c:][ path ]sys[c 1:][ path] D2:
[Description] Because these files need to be copied to a specific location, copying with the copy command may not start the machine. Through the SYS command, DOS can move the files that have occupied a specific location on the target disk and copy the system files to the corresponding location. The parameter C 1:path is used to indicate the directory where the system files are located. If not specified, it defaults to the current directory of the current disk. So this command is usually executed in the root directory of the source disk.
14) pass-Set the directory for DOS lookup. COM,。 EXE and. Bat file.
[format]path =[[drive:]path[; ]] or path
[Description] When only path has no parameters, only the contents of environment variables are displayed. When there are parameters, reset the path variable. When the path environment variable is not specified, DOS first judges whether the command issued by the user is an internal command, and then finds out whether there is a main file name in the current directory that is the executable file of the command. Otherwise, the message "Bad command or file name" will be displayed. If you issue the command to specify the path, search in the specified path in turn. If you still can't find it, the above prompt will appear.
15) cls-clears the contents of the monitor screen and displays a DOS prompt in the upper left corner of the screen.
[format] cls
16) Time-Displays and sets the system time of DOS.
[Format] Time [hh[:mm[:ss[. Cc]]]
17) Date-Displays and sets the system date of DOS.
[Format] Date [YY MM DD YY]
18) ver-Displays the version number of the running DOS system.
[format] version
External command of DOS
The external commands of DOS are just some application programs, which can make the user's operation more convenient and in-depth. These external commands exist in the form of files, and the DOS external commands of Windows system are stored in the "command" directory under the main directory of Windwos. Let's take a look at some common DOS external commands.
1) format. COM format command.
As we all know, newly bought disks must be formatted before they can be used. The format command can format floppy disks and hard disks in the format of "format [drive letter] [parameters]", such as "formAT A: /S". It has two common parameters:
/Q: Conduct quick format;
/S: Complete the formatting and copy the system startup file to this disk.
Note: This command will erase all data on the target disk, so it must be used with care. If it is formatted normally, the data on the disk may be recovered, but if you add "/Q", it will be more difficult to recover than pushing the sky.
2) edit (edit. COM)- Edit command.
In fact, it is a text editing software (as shown in Figure 3). It can be used to easily edit a text file under DOS, and the format is "Edit [file name] [parameters]". Its parameters are not particularly practical, so I won't say it here.
Figure 3
3) SYS (system. System boot file transfer command.
It can transfer multiple files such as IO. SYS to the target disk so that it can be booted and started. The format is "SYS[ drive letter]"
4) Attribute (Attrib. EXE)- file attribute setting command.
With this command, we can view and change the properties of the file. The format is "ATTRIB[ path] [file name] [parameter]". If no parameter is added, the file properties will be displayed. Its parameter is "+?" And "-?" Two kinds, "?" Represents the attribute code, namely: "H" hidden; "s" system; "R" is read-only, "+"means giving, and "-"means removing.
XCOPY (Xcopy。 EXE)- copy command
This command is enhanced on the basis of "copy", and multiple subdirectories can be copied. It has many parameters, but the most commonly used one is "/S", which can copy multiple subdirectories under a directory, and "/E" can copy an empty directory. The format is "XCOPY[ source path] [source directory/file name] [target directory/file name] [parameters]".
6) ScanDisk (ScanDisk. EXE)- Disk Scanner.
This command is very useful in practical operation. It can scan and repair disks, and can solve most problems of disk file corruption. The format is ScanDisk [Drive Letter:] [Parameters]. The following are its parameters:
/fragment[ drive name: \ path \ file name]: Use this parameter to display whether the file contains discontinuous blocks, and we can solve this problem by running the disk defragmenter;
/all: Check and repair all local drives;
/autofix: automatically fix the error, that is, there will be no prompt when repairing;
/checkonly: only check the disk, not fix the error;
/custom: Run Scandisk according to the contents of Scandisk.ini file, which is a text file containing the settings of Scandisk program. The [Custom] block is executed only after the [/Custom] parameter is added, and users can make different settings according to their own situations.
/nosave: delete the missing cluster directly after it is detected, and it will not be converted into a file;
/nosummary: the inspection summary is not displayed, and the program will exit directly after the inspection is completed;
/surface: scan the disk surface after the initial inspection;
/mono: Run ScanDisk in monochrome mode.
We can add different parameters according to different situations. We can execute "ScanDisk/All/CheckOnly/No Save/No Summary" to check the disk and exit automatically. In addition, we can edit the settings in the scandisk.ini file and then run scandisk /custom. If there are many damaged files, we can use "/autofix" to repair them automatically, otherwise you will be busy to death.
7) chkdsk (Chkdsk。 EXE)- Disk Check Command
It checks the disk and displays the disk status report. The format is "CHKDSK[ drive letter:] [parameter]", and the most commonly used parameter is "/F", which can fix file errors.
8) move (move. EXE)- file move command
Use it to move files. The format is "Move [source file] [target path]". Wildcards can also be used.
9) Deltree. EXE)- Delete command
This is a super enhanced version of the DEL command, which can not only delete files, but also delete all files and subdirectories in the specified directory. Using it, we can easily delete the directory completely. The format is "deltatree [file/path] [parameter]", and the parameter has "/Y". When using, the system will ask each file and answer "Y" before deleting it.
10) fdisk (Fdisk。 EXE)- partition command
We can use it to partition the hard disk, which I will explain in detail in the next section.
The above are some common DOS external commands. Using them can make your operation more convenient, and it is also essential for system repair. Please master each command and its usage.
More DOS commands
Command function command function
Ctty changes the properties of the control device property setting file.
Emm386 Extended Memory Management Defragmentation
Calling and establishing dos macro commands in fdisk hard disk partition
Lh/loadhigh Loader Debugging Command to High-end Memory Debugger
Move move file, change directory name fc file comparison
Prompt setting prompt multi-screen display
Smartdrv Settings Disk Accelerator Settings Setting Environment Variables
Subst path replaces setver setting version.
Xcopy replication directories and file volumes display the specified disk volume label.
If you are interested, try to enter these commands in the DOS window yourself.