Complete doscommand set

Source: Internet
Author: User
Reprinted:

Complete doscommand set

1) MD -- create sub-Directories
1. function: Create a New subdirectory
2. Type: Internal commands
3. Format: MD [drive letter:] [path name] <subdirectory Name> 〉
4. Instructions for use:
(1) "drive letter": Specifies the disk drive letter of the subdirectory to be created. If omitted, it is the current drive;
(2) "path name": the parent directory name of the subdirectory to be created. If it is set to the current directory by default.
Example: (1) create a sub-directory named Fox under the root directory of drive C; (2) create a sub-directory named user under the sub-directory of drive C.
C:,> MD Fox (create the sub-directory Fox under drive C)
C:,> MD Fox, user (create a user sub-directory under the fox sub-directory)
(2) Cd-change the current directory
1. function: display the current directory
2. Type: Internal commands
3. Format: CD [drive letter:] [path name] [subdirectory name]
4. Instructions for use:
(1) If the path and subdirectory names are omitted, the current directory is displayed;
(2) If the "cd" format is used, it will be returned to the root directory;
(3) "CD .." The format is returned to the upper-level directory.
Example: (1) enter the user sub-directory; (2) return from the user sub-directory to the sub-directory; (3) return to the root directory.
C:,> Cd Fox, user (enter the user sub-directory under the fox sub-directory)
C:, Fox, user> Cd .. (Return to the root directory of the previous level)
C:, Fox> Cd, (return to the root directory)
C:,>
(3) RD -- delete sub-directory command
1. function: the directory is deleted from the specified disk.
2. Type: Internal commands
3. Format: RD [drive letter:] [path name] [subdirectory name]
4. Instructions for use:
(1) The subdirectory must be empty before deletion. That is to say, you must first enter the subdirectory and use del to delete the files in the subdirectory, then return to the upper-level directory and use the RD command to delete the directory itself;

(2) the root directory and current directory cannot be deleted.
For example, you must delete the user sub-directory under the fox sub-directory of drive C as follows:
Step 1: First delete the files in the user sub-directory;
C.> del C:, Fox, user ,*. *
Step 2: delete the sub-directory of user.
C.> rd c:, Fox, user
(4) dir -- display disk directory command
1. function: display the contents of the disk directory.
2. Type: Internal commands
3. Format: dir [drive letter] [path]

[/W]
4. instructions for use:/P. When there are too many directories to be viewed, the screen cannot be displayed on a screen and will always be rolled up, which is not easy to see. After adding the/p parameter, on the screen, 23 lines of file information are displayed separately, paused, and displayed. Press any key to continue
/W: Add/W to display only the file name. The file size and creation date and time are ignored. After the parameter is added, five file names can be displayed in each line.

Path -- path setting command
1. function: the search path of the executable file of the device, which is only valid for files.
2. Type: Internal commands
3. Format: path [drive letter 1] Directory [path name 1] {[; drive letter 2:], <directory path name 2> 〉...}
4. Instructions for use:
(1) When running an executable file, DOS will first search for the file in the current directory and run it if it is found; if it cannot be found, search for the file in the directory one by one based on the path set by the path command;
(2) If there are more than two paths in the path command, they are separated by a semicolon;
(3) There are three ways to use the path command:
Path [drive letter 1:] [Path 1] [drive letter 2:] [Path 2]… (Set the search path for executable files)
Path: (cancel all paths)
Path: (display the current path)
(6) tree-command for displaying the disk directory structure
1. function: Display All directory paths on the specified drive and all file names under these directories.
2. Type: External commands
3. Format: Tree [drive letter:] [/F] ["PRN]
4. Instructions for use:
(1) When the/F parameter is used, all directories and all files under the directories are displayed. When omitted, only directories are displayed, but files under the directories are not displayed;
(2) When the PRN parameter is selected, the file names in the listed directories and directories are printed and output.
(7) deltree -- delete the entire directory command
1. function: Delete the entire directory and its sub-directories and files.
2. Type: External commands
3. Format: deltree [drive letter:] <Path Name> 〉
4. instructions for use: This command can delete all the files, subdirectories, and lower-level subdirectories in the directory and Its Directory, regardless of whether the file attributes are hidden, system, or read-only, as long as the file is under the deleted directory, the deltree will be treated equally. Be careful when using it !!!
V. Disk operation commands

(1) format -- disk formatting command
1. function: format the disk, divide the magnetic channels and sectors, and check whether there are any defective tracks on the entire disk, mark the bad channels, and create a directory area and file allocation table, prepare the disk for DOS reception.
2. Type: External commands
3. Format: Format <drive letter:> [/S] [/4] [/q]
4. Instructions for use:
(1) The drive letter after the command cannot be default. If you format the hard disk, the following prompt will be displayed: Warning: all data on non -- removable disk
Drive C: Will be lost!
Proceed with format (y/n )?
(Warning: all data on drive C will be lost. Are you sure you want to continue formatting ?)
(2) If a floppy disk is formatted, the following prompt is displayed: insertmew diskette for drive;
And press Enter when ready...
(Insert a new disk into drive a, and press the Enter key after preparation ).
(3) When the [/S] parameter is selected, the DOS system file IO. sys, msdos. sys, and command. com will be copied to the disk so that the disk can be used as a DOS boot disk. If the/S parameter is not selected, the formatted ephemeral disk can only read and write information, but cannot be used as the boot disk;
(4) Select the [/4] parameter to format A kb low-density disk in a MB high-density soft drive;
(5) use the [/q] parameter for quick formatting. This parameter does not redivide the disk's magnetic track and fan area. You can only clear the disk root directory, file allocation table, and boot sector to a blank space, therefore, the formatting speed is faster.
(6) If the parameter is selected, it indicates unconditional formatting, that is, destroying all data on the original disk. If/u is not added, it is formatted securely. In this case, create a mirror file to save the original fat table and root directory. If necessary, use unforrmat to restore the original data.
(2) unformat restore formatting command
1. function: restore a disk that has lost data due to formatting or misoperations.

2. Type: External commands
3. Format: unformat <drive letter> [/L]

[/Test]
4. Instructions for use: Used to restore a disk that is "non-destructive" format. When the deleted files or subdirectories under the root directory and the system sector of the disk (including fat, root directory, Boot Sector, and hard disk partition table) are damaged, unformat can also be used for rescue.
(1) Select the/L parameter to list the found sub-directory name, file name, filial piety date and other information, but it does not really do the format work.
(2) Select the/p parameter to display the Report on the screen (including the information generated by the/L parameter) and send it to the printer. "Print out will be sent to LPT1" will be displayed on the runtime Screen"
(3) The/test parameter is used only for the simulation test without the real write action. When this parameter is used, the screen displays "simulation only"
(4) use the/u parameter to unformat data that does not use the mirror image file.
(5) Select/psrtn to fix the hard disk partition table.
If one of the/P,/L, And/test parameters is added after the drive letter, the/u parameter is used. unformat will "assume" that the disk does not have the mirror image file.
Note: unformat can be completely restored for the disk that just formatted. However, if other data is written after format, unformat cannot be completely recovered. Unformat is not omnipotent. Because unformat is used to recreate the fat and root directories, it is also highly risky. Improper Operations may increase the loss. If only a few files or subdirectories are accidentally deleted, you only need to use undelete.
3) chkdsk -- command for checking the current disk status
1. function: displays the disk status, memory status, and the number of specified files in the specified path.
2. Type: External commands
3. Format: chkdsk [drive letter:] [path] [file name] [/F] [/V]
4. Instructions for use:
(1) If the [file name] parameter is selected, the disk occupied by the file is displayed;
(2) Select the [/F] parameter to correct logical errors found on the specified disk;
(3) Select the [/V] parameter to display all files and paths on the disk.
(4) diskcopy-full disk Copy command
1. function: copy a floppy disk in the same format and content.
2. Type: External commands
3. Format: diskcopy [drive letter 1:] [drive letter 2:]
4. Instructions for use:
(1) If the target floppy disk is not formatted, the system will automatically select and format it during the copy process.
(2) If the original files on the target floppy disk are copied, all files will be lost.
(3) if it is a single-drive copy, the system will prompt you to change the source and target disks in a timely manner. Please note that the source and target disks should be cleaned during operation.
(5) label -- create a disk volume label command
1. function: create, modify, and delete disk volume labels.
2. Type: External commands
3. Format: Label [drive letter:] [Volume name]
4. Instructions for use:
(1) The volume name is the name of the volume to be created. If this parameter is set by default, the system prompts you to enter the volume name or ask whether to delete the original volume name;
(2) The name of the volume consists of 1 to 11 characters.
(6) vol-command for displaying disk volumes
1. function: view the disk volume number.
2. Type: Internal commands
3. Format: Vol [drive letter:]
4. Usage: If the drive letter is omitted, the current drive volume label is displayed.
(7) Scandisk-disk detection and repair commands
1. function: Check whether the fat table, directory structure, and file system of the disk are faulty, and fix the detected problems.
2. Type: External commands

3. Format: Scandisk [drive letter 1:] {[drive letter 2:]…} [/All]
4. usage:
(1) ccandisk is applicable to hard disks and floppy disks. You can specify multiple disks at a time or use the [/All] parameter to specify all disks.
(2) you can automatically detect and fix logical errors in the disk, such as cross * connections, lost clusters, and directory structures.
(8) defrag -- Disk reorganization command
1 .. Function: sorts out disks and removes disk fragments.
2. type: external command
3. format: defrag [drive letter:] [/F]
4. instructions for use: Use the/F parameter to remove fragments on the disk that exist in the file, and adjust the disk file arrangement to ensure that there is no gap between files. This speeds up disk reading and saves disk space.
(9) sys -- System Copy command
1. function: loads the DOS system file on the current drive. sys, msdos. sys and command. com to the specified drive.
2. type: external command
3. format: SYS [drive letter:]
* usage Description: if the remaining disk space is insufficient to store system files, the system prompts no roomfor on destination disk.

file operation commands
(1) copy a file copy command
1. function: copy one or more files to a specified disk.
2. type: Internal Command
3. format: copy [Source disk] [path] [target disk] [path] [target file name]
4. instructions for use:
(1) copy is a file-to-file copy method. The target disk must be formatted before copying.
(2) During the copy process, old files with the same file name on the target disk will be replaced by the source file.
(3) When copying a file, you must first determine that the target has enough space; otherwise, the target will appear; insufficient error message, indicating that the disk space is insufficient.
(4) Allow the wildcard "*" in the file name? ", Multiple files can be copied simultaneously.
(5) the source file name must be specified in the Copy command and cannot be omitted.
(6) When copying a file, the target file name can be the same as the source file name, called "copy with the same name". In this case, the target file name can be omitted.
(7) When copying a file, the target file name can also be different from the source file name, which is called "copying by different names". In this case, the target file name cannot be omitted.
(8) When copying, you can also combine several files into one file, which is called "merge copy". The format is as follows: copy; [Source disk] [path] 〉... [Target disk] [path] ;
(9) using the Copy command, you can also input data on the keyboard to create a file. The format is as follows: copy CON [drive letter:] [path] ;
(10) Note: The format of the Copy command must be blank between the source file name and the target file name!
(2) xcopy -- directory Copy command
1. function: copy the specified directory and all files in the directory together with the directory structure.
2. type: external command
3. format: xcopy [Source Disk:] [target disk:] [target path name] [/S] [/V] [/E]
4. instructions for use:

(1) xcopy is an extension of copy. You can copy the specified directory and the directory structure, but cannot copy hidden files and system files.
(2) specify at least one source drive letter, source target path name, and source file name.
(3) Copy all files in the source directory and Its subdirectories when/s is selected. Unless the/e parameter is specified, the/s will not copy the empty directory. If the/S parameter is not specified, xcopy will only copy the files in the source directory, but will not involve the subdirectories under it;
(4) When the/V parameter is selected, the copied slice is verified, but the speed is reduced.
(3) type -- command for displaying file content
1. function: displays the content of an ascii code file.
2. Type: Internal Command.
3. format: Type [drive letter:] [path]
4. instructions for use:
(1) displays text files consisting of ASCII codes. EXE. COM and other files with the extension. The displayed content is unreadable and has no practical significance. 2.
(2) this command can only display the content of one file at a time, wildcards cannot be used.
(3) if a file has an extension, you must enter the extension.
(4) if the file is long and cannot be displayed on a screen, the Type [drive letter:] [path] | more, more is the split screen display command. When some parameters are used, the screen is paused when the screen is full, press any key to continue the display.
(5) to print the file content, use the following format:
type [drive letter:] [path] ,> PRN
, the printer should be online.
(4) Ren -- file RENAME Command
1. function: Change the file name
2. type: Internal Command
3. format: Ren [drive letter:] [path]
4. instructions for use:
(1) the drive letter and path cannot be added before the new file name, because the command can only replace the file name on the same disk;
(2) allows you to use wildcards to change a group of file names or extensions.
(5) FC-file comparison command
1. function: Compare the similarities and differences of files and coordinate the differences on business trips.

2. Type: External commands
3. Format: FC [drive letter:] [path name] <File Name> [drive letter:] [path name] [file name] [/A] [/C] [/n]
4. Instructions for use:
(1) Select/A as the ASCII code comparison mode;
(2) Select/B as the binary comparison mode;
(3) Use the/C parameter to treat uppercase and lowercase characters as the same characters.
(4) Select the/n parameter to display the line number of the difference in the ASCII code comparison mode.
(6) attrib -- command for modifying file attributes
1. function: Modify the attributes of a specified file. (For file attributes, see section 2.5.4 (2) file attributes)
2. Type: External commands.
3. Format: attrib [file name] [r] [-- R] [a] [-- A] [H] [-- H] [s] [-- S] [/S]
4. Instructions for use:
(1) Select the R parameter and set the specified file as a read-only attribute so that the file can only be read and cannot be written or deleted; select the -- R parameter to remove the read-only attribute;
(2) Select the parameter and set the file as the file attribute; select the -- a parameter to remove the file attribute;
(3) Use the H parameter to associate the file with an implicit attribute. Use the -- H parameter to remove the implicit attribute;
(4) Select the S parameter and set the file as the system attribute. Select the -- S parameter to remove the system attribute;
(5) Select the/S parameter to set all the subdirectories in the current directory.

7) del -- delete file command
1. function: delete a specified object.
2. Type: Internal commands
3. Format: del [drive letter:] [path] <File Name> 〉

4. instructions for use:
(1) Select the/p parameter. The system will ask whether to delete the file before deleting the file. If this parameter is not used, the file will be deleted automatically;
(2) this command cannot delete files whose attributes are implicit or read-only.
(3) wildcards can be used in file names.
(4) if you want to delete all files (DEL * or del *) on the disk, the following message is displayed: (arey ou sure ?) (Are you sure you want ?) If yes, delete the job. If yes, cancel the job.
(8) undelete -- Restore DELETE command
1. function: Restore deleted by mistake
2. Type: external command.
3. format: undelete [drive letter:] [path name] [/DOS]/LIST] [/All]
4. instructions for use: "*" and "?" can be used for undelete." Wildcard.
(1) Use/DoS parameters to restore files based on the residual records in the directory. When a file is deleted, the first character of the file name recorded in the directory will be changed to E5. DOS will find the file to be restored Based on The E5 at the beginning of the file and its subsequent characters, undelete requires you to enter a character to complete the file name. However, this character does not have to be the same as the original one. It only needs to comply with the DOS file name rules.
(2) Select/list to "list" only files meeting the specified conditions without restoration. Therefore, the disk content will not be affected at all.
(3) Select/all to automatically restore all files that can be completely recovered without asking users one by one. When using this parameter, if undelte uses the remaining records in the directory to restore the file, a character is automatically selected to complete the file name and make it not the same as the existing file name. The optimal sequence of characters used is: # % -- 2017123456789a ~ Z.

undelete also provides the file creation protection function, which is beyond the scope of this course. Please refer to the relevant dos manual when using some functions.
7. Other commands
(1) CLS -- screen clearing command
1. function: clear all the displays on the screen and place the cursor in the upper left corner of the screen.
type 2: Internal Command
3 Format: CLS
(2) Ver command for viewing system version number
1 function: display the current system version
2 type: Internal Command
3 Format: ver
(3) data date setting command
1 function: set or display the system date.
type 2: Internal Command
3 Format: Date [mm -- dd -- YY]
4 usage instructions:
(1) omit [mm -- dd -- YY] to display the system date and prompt to enter a new date. If you do not modify the date, press the Enter key, [mm -- dd -- YY] is in the format of "month"-"month"-"day"-"year".
(2) when the machine starts to start, Automatic File Processing (autoexec. BAT) is executed, the system does not prompt to enter the system date. Otherwise, the system prompts you to enter a new date and time.
(4) Time system clock setting command
1 function: set or display the system period.
type 2: Internal Command
3 Format: time [hh: mm: SS: XX]
4 usage instructions:
(1) if [hh: mm: SS: XX] is omitted, the system time is displayed and a new time is prompted. If you do not modify the time, press the Enter key directly. [hh: mm: SS: XX] is in the format of "hour: minute: Second: percent seconds".
(2) when the machine starts to start, there is an automatic File Processing (autoexec. BAT) is executed, the system does not prompt to enter the system date. Otherwise, the system prompts you to enter a new date and time.
(5) MEm command to view the current memory status
1 function: display the current memory usage
2 type: external command
3 format: mem [/C] [/F] [/m]

4. Instructions:
(1) The/C parameter is used to list the length of each file loaded into the regular memory and CMB, and the memory usage and maximum available space are also displayed;
(2) Select the/F parameter to list the remaining bytes of the current general memory and the available regions and sizes of umb;

(3) The/M parameter is used to display the memory address, size, and nature of the module;
(4) The/p parameter is used to specify that when the output exceeds one screen, it is paused for users to view.
(6) MSD command for Displaying System Information
1 function: displays the hardware and operating system status of the system.
Type 2: External commands
3 Format: MSD [/S]
4. Instructions:
(1) hardware is not detected when/I parameters are selected;
(2) Start MSD in black and white mode when/B is selected;
(3) A Concise system report is displayed when/S parameters are selected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.