### Basic DOS Commands
- `cd` Change current directory `sys` Make DOS system disk
- `copy` Copy files `del` Delete files
- `deltree` Delete directory tree `dir` List file names
- `diskcopy` Copy disk `edit` Text editing
- `format` Format disk `md` Create subdirectory
- `mem` View memory status `type` Display file contents
- `rd` Delete directory `ren` Change file name
Remember how much you can? If you forget, go to class to see. The following four commands are new, give the command format, you try it yourself. Learning computers is important is to explore.
- `cls` Clear screen
[Applicable occasion] The screen is too messy, or there is garbled on the screen, clear the content displayed on the screen but does not affect any information inside the computer
[Usage] `cls` Press Enter
- `move` Move files, change directory name
[Applicable occasion] Move files to other directories
[Usage] `move [file name] [directory]` Move the file to the new directory
`move [directory name] [directory name]` Change directory name
[Example] `c:\>move c:\autoexec.bat c:\old??`
Move the autoexec.bat file to the old directory
`c:\>move c:\config.sys c:\old??`
Move the config.sys file to the old directory
- `more` Display in pages
[Applicable occasion] When the output is too much to fit on one screen, it is suitable for almost all commands, especially when using commands like type. When using more, the disk must not be write-protected, and it is not suitable for optical drives.
[Usage] `type [file name] | more` Display file contents in pages
`more < [file name]` Display file contents in pages
[Example] `C:\>type msdos.w40 | more`
- `xcopy` Copy directories and files
[Applicable occasion] It is very useful when copying subdirectories together. It is much faster than the COPY command when copying a large number of files
[Usage] `xcopy [file name] [directory]` Copy the specified file to the specified directory
`xcopy [source directory] [destination directory]` Copy the source directory and subdirectories to the destination directory
`xcopy *.* [directory] /s` Copy files and non-empty subdirectories to the specified directory
Other common parameters also include: v Verify after copying, which will affect the speed
e Similar to s, but even if the subdirectory is empty, it will be copied.
`help` Help
[Applicable occasion] When you want to specifically understand the usage of DOS commands
[Usage] `help` Provide help for all DOS commands
`help [DOS command]` Provide help for the relevant command
If you only roughly remember a certain command, you can directly enter the help command after the prompt, and the following screen will appear:
- `attrib` Set file attributes
[Applicable occasion] When you want to do more special processing on files
[Usage] `attrib` Display the attributes of all files
`attrib +r or -r [file name]` Set whether the file attribute is read-only
`attrib +h or -h [file name]` Set whether the file attribute is hidden
`attrib +s or -s [file name]` Set whether the file attribute is a system file
`attrib +a or -a [file name]` Set whether the file attribute is an archive file
`attrib /s` Set the file attributes including files in subdirectories
[Example] `C:\TEST>attrib +r wina20.386`
`C:\>attrib +h *.* /s??` Hide all files
- `date` Display and modify date
[Applicable occasion] Want to know or modify the time and date
[Usage] `date` Display and change the current date
[Example] `C:\>date 09-20-1996??` Change the date to September 20, 1996
`C:\>date??`
Current date is Tue 08-20-1996
Enter new date (mm-dd-yy):09-20-1996
Modify the current date in the order of month-day-year. Press Enter directly to ignore the modification date
- `label` Set volume label
[Applicable occasion] Used to mark the disk
[Usage] `label` Display the disk volume label
`label [drive letter] [volume label name]` Set the volume label of the specified disk
[Example] `C:\>label??`
Volume in drive C is WANG
Volume Serial Number is 2116-1DD0
volume label (11 characters,Enter for none)?
You can enter the volume label, press Enter directly
Delete current volume label (Y/N)?
Press y to delete the old volume label, press n to not change
- `defrag` Disk defragmentation
[Applicable occasion] The disk has been read and written many times, or the disk has been used for a long time. You may need to use this command to defragment the disk. Disk fragmentation does not mean that the disk is broken, but just because after multiple copies and deletions of files, the disk usage will be very fragmented, resulting in slower speed.
[Usage] 1. `C:\>defrag??`
2. Select the disk to be defragmented
3. The computer analyzes the disk status, then tells us how much needs to be defragmented. Press the Esc key
4. Select Optimization Method (disk optimization method), select "Optimize all" or "Optimize only files"
5. Select Begin Optimization to start defragmentation
6. After defragmentation is complete, press Enter
7. Press Esc to exit.
`doskey` Call and create DOS macro commands
[Applicable occasion] When you often need to enter repeated commands, it is very useful
[Usage] `doskey`
Resident `doskey` in memory, open a buffer, and the commands entered later will be saved in the buffer and can be called at any time
`doskey [macro command name]=[command name]`
Define the macro command as a command, and later enter the macro command, the computer will execute the corresponding command
`doskey /reinstall` Reinstall `doskey`
`doskey /bufsize= ` Set the size of the buffer
`doskey /macros` Display all `doskey` macros
`doskey /history` Display all commands in memory
`doskey /insert|overstrike` Set whether the newly typed characters overwrite the old characters
[Example] `C:\>DOSKEY??`
`C:\>dir`
`C:\>copy C:\temp\*.* a:`
`C:\>del c:\temp\*.*`
`C:\>copy b:\*.* c:\temp`
The above four commands have all been saved. You can use the up and down cursor control keys to select and use or modify them one by one. You can also use the F7 key to list all saved commands
`C:\>doskey di=dir/w/p??` Define di as a macro command, which means to execute dir/w/p
- `fdisk` Hard disk partitioning
[Suggestion] Only when the hard disk is severely infected by a virus, or a new hard disk needs to be partitioned. It is best to ask someone who understands to guide. The hard disk needs to go through three steps: low-level formatting, partitioning, and formatting before it can be used. The hard disks in finished computers have already been processed.
[Usage] Enter `fdisk` and press Enter to enter the prompt interface
- `emm386` Extended memory management
[Suggestion] This command is more complicated and will be introduced in detail in the system configuration in Chapter 5
`lh/loadhigh` Load the program into the upper memory
[Applicable occasion] This command is generally used in autoexec.bat. When some software requires a large amount of basic memory, it will be useful
[Usage] `lh [program]`
Load the program into the upper memory. When using this command, the following two statements need to be in the config.sys file. `device=emm386.exe dos=umb`
`lh [program] /l:area number` Load the program into the specified umb area
`lh /s` Generally dedicated by memmaker
[Example] `C:\MOUSE\>lh mouse??` Load the mouse driver program into the upper memory
- `memmaker` Memory optimization management
[Applicable occasion] This command is now rarely used. When DOS was popular in those days, if you wanted to play games, you couldn't do without it. It can free up a lot of basic memory for games, and it only needs to be installed once
[Usage] 1. `C:\>memmaker??`
2. Press Enter to continue, F3 to exit
3. Select manual installation and automatic installation. Press Enter directly to indicate automatic installation (just press Enter)
4. Select whether there are programs that need to expand memory. You can use the space bar to select. Yes means yes, No means no, and press Enter.
5. The program automatically detects whether WINDOWS is installed in the hard disk
6. If there is a floppy disk in the floppy drive, you should take it out, then press Enter, and the computer will restart twice. Do not interrupt, just press Enter.
(In fact, it's very simple, just keep pressing Enter, heh heh)
- `msd` System detection
[Applicable occasion] Used to check system information
[Usage] 1. `C:\>msd` After pressing Enter, you can see the following screen, and annotations are added next to each option to indicate the function of the button
?? 2. Select the project to be queried. For example, select the first Computer, and a dialog box will pop up to display some basic information of the computer. You can try other options to see what they are used for.
3. After activating the drop-down menu by pressing Alt+F key, select the "Exit" item to exit.
- `undelete` Restore deleted files
[Applicable occasion] When you accidentally delete the wrong file, it can be used.
When DOS deletes a file, it only removes the file from the allocation table and deletes the first letter of the file name in the disk storage area. The file content is not immediately deleted from the disk, so it can be recovered.
[Usage] `undelete` Restore deleted files
`undelete /all` Restore files and do not ask again whether to restore,
The first letter is in the order of "#%&-0123456789abcdefghijklmnopqrstuvwxyz" to restore the file
`undelete /list` List recoverable file names
`undelete /s` Can resident `undelete` in memory, but almost no one uses it like this
`prompt` Set prompt
[Applicable occasion] When you are tired of the prompt of c:\> or you want to make your prompt different, you can give it a try. It is a very interesting DOS command that can display the time and date at any time.
[Usage] `prompt $p$g` Use the current directory name and > sign as the prompt, which is the most commonly used prompt
`prompt $t` means time `prompt $d` means date
`prompt $$` means $ `prompt $q` means =
`prompt $v` means current version `prompt $l` means <
`prompt $b` means | `prompt $h` means backspace character
`prompt $e` means the character represented by Esc `prompt $_` means carriage return and line feed
[Example] `C:\DOS>prompt wang$g??` Set wang> as the prompt
`WANG>prompt $t$d$g??` Use time, date and > sign as the prompt
`0:01:07.77Thu 08-29-1996>prompt $p$g??`
`C:\DOS> `
- `restore` Restore backed up files
[Suggestion] If you have backed up files with backup before, you can use it to restore files when the original file is damaged.
Restore the files in the disk backed up with the backup command to another disk. There should be two files backup.00X and control.00X in the backup disk.
[Usage] `restore [backup drive letter] [target drive letter]`
Restore the backup files on the backup disk to the specified disk
`restore /s` Restore backup files including subdirectories to the specified disk
`restore /p` Let the user judge whether to restore the file
`restore /b: date` Restore files before the date
`restore /a: date` Restore files after the date
`restore /l: time` Restore files before the time
`restore /e: time` Restore files after the time
`restore /m` Only restore files modified after the last backup
`restore /n` Only restore files deleted after the last backup
`restore /d` Only display the file names to be restored
[Example] `C:\DOS>restore a: c:??`
Insert backup diskette 01 in drive A:
Press any key to continue . . .
Put the first backup disk in drive A, press any key, and after restoring the first one, put the other disks in order.
When the above command cannot restore the file correctly, please use:
`C:\DOS>restore a: c:\ /s??`
`time` Display and modify time
[Applicable occasion] Used to display and modify time, the usage is the same as date
[Example] `C:\\DOS>time??`
Current time is 12:15:26.04a
Enter new time: 11:20:20.00p
Enter the time in the order of hour: minute, and then add afternoon (a/p). Press the ENTER key directly to ignore the modification time.
- `set` Set environment variables
[Applicable occasion] Used when setting up sound cards and paths, etc.
[Usage] `set [environment variable]=[string]`
This command is often used in autoexec.bat
[Example] `C:\>set blaster=a220 i5 d1` Set the parameters of the sound card
`C:\>set path=c:\dos` The meaning of path c:\dos is the same
- `smartdrv` Set disk accelerator
[Suggestion] It can improve the hard disk access speed. It is best to load it in the autoexec.bat file.
[Usage] `smartdrv /x`
Execute and resident in memory, open the disk acceleration cache area, and shield all drive caches. This is a more commonly used method (usually this command is enough)
`smartdrv /c` Write all information in the cache to the hard disk
`smartdrv /e: number` Set the amount of information moved at one time
`smartdrv /b: number` Set the size of the pre-read buffer
`append` Set the path of non-executable files
[Applicable occasion] When you can't find the manuscript you entered in multiple directories, you can give this command a try. The usage is similar to path.
[Usage] `append [path];[path]`
[Example] `C:\>append c:\test??`
Set the path to find non-executable files to c:\\test. If there is a file 1.txt in this directory, when 1.txt is not found in other directories, it can be automatically found in the c:\\test directory.
`D:\UCDOS>edit 1.txt` can find the C:\test\1.txt file
- `debug` Program debugging command
[Suggestion] If you have learned assembly language, then you should be able to use debug. If you haven't learned it, it's better not to use it
[Usage] `debug [file name]`
- `diskcomp` Compare disks
[Applicable occasion] Compare whether two disks are the same. I don't know when it will be used. When comparing two disks copied with diskcopy, why not use diskcopy/v to verify?
[Usage] `diskcomp [drive letter 1] [drive letter 2]` Compare disk 1 and disk 2
`diskcomp /1` Compare only the first side of the disk
`diskcomp /8` Compare only the first 8 sectors of each track
[Example] `C:\>diskcomp a: a:`
Compare two disks in the same floppy drive
Insert FIRST diskette in drive A:
Put the first disk
Press any key to continue . . .
Comparing 80 tracks 18 sectors per track, 2 side(s)
Insert SECOND diskette in drive A:
Put the second disk
Press any key to continue . . . Compare OK
No difference found in comparison
Compare another diskette (Y/N) ?n
Whether to compare other disks, select y to continue comparing, select n to stop
- `expand` Decompression tool
[Applicable occasion] There are many compressed files with suffixes ending with "_" in the original installation disk of Microsoft software. You can use it to decompress and get rid of the trouble caused by the loss of a few files.
[Usage] `expand [source file name] [destination file]`
[Example] `C:\>expand a:vsafe.co_ c:\dos\vsafe.com`
?妗〗庋?vsafe.co_ is the vsafe.com file
Microsoft (R) File Expansion Utility Version 2.10 Copyright (C) Microsoft Corp 1990-1993. All rights reserved.
Expanding a:vsafe.co_ to c:\dos\vsafe.com. a:vsafe.co_:33046 bytes expanded to 62576 bytes, 89% increase.
`C:\DOS> `
- `fasthelp` Quickly display help information
[Suggestion] You can see all the commands. For a single command, it is not as convenient as adding the /? parameter after the command name
[Usage] `fasthelp` List the uses of all DOS commands
`fasthelp [command name]` Display the use of the command, equivalent to [command name]/?
- `fc` File comparison
[Suggestion] Maybe it will never be used by most people
[Usage] `fc [file name 1] [file name 2]` Compare the differences between the two files. Parameters also include: a c l Lbn n t w nnnn
[Example] `C:\TEST>fc a.bat b.bat??`
Comparing files A.BAT and B.BAT
***** A.BAT
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag
if errorlevel 2 goto mem
if errotlevel 1 goto end
***** B.BAT choice /c:dme defrag,mem,end
***** C:\TEST>
- `interlnk` Start simple network client
[Applicable occasion] If there are two computers, they can be connected into a simple network with it and intersvr. This is a very useful command, but it is not commonly used
[Usage] DOS newly supports network functions,
It can connect two computers through a parallel port cable or serial port cable to form a simple network. To use interlnk, you must add a sentence to config.sys:
`device=c:\dos\interlnk`
Both ends of the parallel port cable should be 25-pin male connectors. The connections between the pins are as follows: corresponding
p2------------------------p15
p3------------------------p13
p4------------------------p12
p5------------------------p10 Male connector means the connector is with pins
p6------------------------p11 Female connector means the connector is with holes
p15-----------------------p2
p13-----------------------p3
p12-----------------------p4
p10-----------------------p5
p11-----------------------p6
p25-----------------------p25 Ground
[Example] `C:\DOS\>interlnk Port-LPT1`
this Computer Other Computer
(Client) (Server)
----------------------------------------
E: equals A:
F: equals C:
In the client, drive E is the server's drive A, and drive F is the server's drive C
- `intersvr` Start simple network server
[Applicable occasion] Using it, the computer becomes a server (only for the simple network provided by DOS)
[Usage] `intersvr` Start the server
`intersvr /lpt:1` Start the server, use lpt1 port as the data transmission port
`intersvr /com:1` Start the server, use com1 port as the data transmission port
Parameters also include x baud: b v rcopy (see interlnk)
[Example] `C:\DOS>intersvr??`
- `qbasic` Start Basic integrated environment
[Suggestion] Maybe it will never be used by most people
[Usage] If you know qbasic language, then you can use it to write your own program. edit.com must have it to be available.
`qbasic` Start the basic language environment
`qbasic/editor` Edit the language in full screen
Parameters also include: b g h mbf nohi run
[Example] `C:\DOS>qbasic??`
- `setver` Set version
[Applicable occasion] When you want to use the commands of other versions of DOS, you can use it to deceive the computer. In high-version DOS, when some old-version programs need DOS3.3, you can use setver to set
[Usage] Generally, add `device=setver.exe` to config.sys when using
`setver` Display the version of the file
`setver [file name] n.nn` Set the version number of the specified file
[Example] `C:\DOS>setver??`
KERNEL.EXE 5.00
DOSOAD.SYS 5.00
EDLIN.EXE 5.00
BACKUP.EXE 5.00
ASSIGN.COM 5.00
EXE2BIN.EXE 5.00
JOIN.EXE 5.00
RECOVER.EXE 5.00
WINWORD.EXE 4.10
`C:\> `
If the program AAA.exe must be executed under MS-DOS3.3, then type
`C:\DOS>setver aaa.exe 3.30??`
For example, net5.exe only runs under MS-DOS5.0, then after adding `device=setver.exe` in config.sys, it can also run under Ms-DOS6.22.
- `share` File sharing
[Suggestion] Only use it when the software declares that it must be run
[Usage] You can add `install=share.exe` to config.sys, or you can directly run the parameters with f l
- `subst` Path replacement
[Suggestion] A very interesting command, which may be useful if you often use CD-ROM software.
[Usage] `subst` Display the current alternative path
`subst [drive letter] [path]`
Replace the specified path with the drive letter, and this path will be used as the drive
`subst /b` Remove the substitution
[Example] `C:\DOS>subst a: c:\temp??` Replace the c drive temp directory with drive a
`C:\>subst a: /d?妗 〗獬?substitution
- `tree` Display command tree structure
[Applicable occasion] View all subdirectories
[Usage] `tree [drive letter]` Display all subdirectory trees
`tree /f` Display file names while displaying directories
`tree /a` Display directory tree in ASCII code
[Example] `C:\WINDOWS>tree /a??`
- `unformat` Restore formatted disk
[Suggestion] You formatted the floppy disk with important information? Quickly use unformat... What? You used format /u, then it's dead
[Usage] `unformat [drive letter]` Restore the specified formatted disk
`unformat /l` Display the file names found by unformat
[Example] `C:\WINDOWS>unformat a:??`
- `vsafe` Virus protection program
[Suggestion] Loading it into memory can detect many kinds of viruses at any time, which is relatively useful.
[Usage] `vsafe` Load vsafe in memory
`vsafe /u` Remove vsafe from memory
`vsafe/ne` Load vsafe into extended memory
`vsafe/nx` Load vsafe into expanded memory
Parameters also include Ax Cx n d
[Example] `C:\>vsafe`
- `ver` Display DOS version
[Example] `C:\>ver`
??MS-DOS Version 6.22
`C:\> `
- `vol` Display the specified disk volume label
[Example] `C:\>vol??`
Volume in drive C is Wang
Volume Serial Number is 2116-1DD0
`C:\> `
- `ctty` Change control device
[Suggestion] Used to change the input
Output device, you can try this command, but I'm afraid it won't have any effect. It is one of the most useless commands in DOS
[Usage] `ctty [device name]` Set the console
[Example] `C:\>ctty aux??` Set aux as the input and output device.
Introduced so many commands, is it dazzling? The key to learning DOS is to practice various commands more, but I have to remind you that some commands need to be careful, otherwise you will regret it later.
- `del *.*` Delete all files in the current directory
[Suggestion] Using `del *.*` in the root directory of drive C will make the computer unable to find the mouse, CD-ROM, unable to use windows, and even unable to start. In fact, when using this command in any directory, you need to think carefully.
- `deltree *.*` Delete all directories and files under the current directory
[Suggestion] When using this command in the root directory of drive C, you must make sure that your mind is clear, and you are sure that this is necessary, but we think that you should not use this command in any case. Using `deltree *.*` in any directory will produce the same or even worse results as `del *.*`. Be careful! Be careful!
- `format c:/u` Format drive C
[Suggestion] Unless your hard disk is deeply infected by a virus, or a real computer expert tells you that you should do this, do not format drive C. It will make you lose all information and take several hours to reinstall all software.
- `fdisk` Hard disk partitioning
[Suggestion] When partitioning the hard disk, be sure to let someone who has used this command to help you use it, otherwise you will lose all information and even be unable to use the hard disk.
- `recover` Overwrite disk
[Suggestion] This command is no longer available after DOS 6. If you are using an old version of DOS, it is advised that you do not use it at any time. It has no other effect except to destroy all information on your hard disk.
- `cd` Change current directory `sys` Make DOS system disk
- `copy` Copy files `del` Delete files
- `deltree` Delete directory tree `dir` List file names
- `diskcopy` Copy disk `edit` Text editing
- `format` Format disk `md` Create subdirectory
- `mem` View memory status `type` Display file contents
- `rd` Delete directory `ren` Change file name
Remember how much you can? If you forget, go to class to see. The following four commands are new, give the command format, you try it yourself. Learning computers is important is to explore.
- `cls` Clear screen
[Applicable occasion] The screen is too messy, or there is garbled on the screen, clear the content displayed on the screen but does not affect any information inside the computer
[Usage] `cls` Press Enter
- `move` Move files, change directory name
[Applicable occasion] Move files to other directories
[Usage] `move [file name] [directory]` Move the file to the new directory
`move [directory name] [directory name]` Change directory name
[Example] `c:\>move c:\autoexec.bat c:\old??`
Move the autoexec.bat file to the old directory
`c:\>move c:\config.sys c:\old??`
Move the config.sys file to the old directory
- `more` Display in pages
[Applicable occasion] When the output is too much to fit on one screen, it is suitable for almost all commands, especially when using commands like type. When using more, the disk must not be write-protected, and it is not suitable for optical drives.
[Usage] `type [file name] | more` Display file contents in pages
`more < [file name]` Display file contents in pages
[Example] `C:\>type msdos.w40 | more`
- `xcopy` Copy directories and files
[Applicable occasion] It is very useful when copying subdirectories together. It is much faster than the COPY command when copying a large number of files
[Usage] `xcopy [file name] [directory]` Copy the specified file to the specified directory
`xcopy [source directory] [destination directory]` Copy the source directory and subdirectories to the destination directory
`xcopy *.* [directory] /s` Copy files and non-empty subdirectories to the specified directory
Other common parameters also include: v Verify after copying, which will affect the speed
e Similar to s, but even if the subdirectory is empty, it will be copied.
`help` Help
[Applicable occasion] When you want to specifically understand the usage of DOS commands
[Usage] `help` Provide help for all DOS commands
`help [DOS command]` Provide help for the relevant command
If you only roughly remember a certain command, you can directly enter the help command after the prompt, and the following screen will appear:
- `attrib` Set file attributes
[Applicable occasion] When you want to do more special processing on files
[Usage] `attrib` Display the attributes of all files
`attrib +r or -r [file name]` Set whether the file attribute is read-only
`attrib +h or -h [file name]` Set whether the file attribute is hidden
`attrib +s or -s [file name]` Set whether the file attribute is a system file
`attrib +a or -a [file name]` Set whether the file attribute is an archive file
`attrib /s` Set the file attributes including files in subdirectories
[Example] `C:\TEST>attrib +r wina20.386`
`C:\>attrib +h *.* /s??` Hide all files
- `date` Display and modify date
[Applicable occasion] Want to know or modify the time and date
[Usage] `date` Display and change the current date
[Example] `C:\>date 09-20-1996??` Change the date to September 20, 1996
`C:\>date??`
Current date is Tue 08-20-1996
Enter new date (mm-dd-yy):09-20-1996
Modify the current date in the order of month-day-year. Press Enter directly to ignore the modification date
- `label` Set volume label
[Applicable occasion] Used to mark the disk
[Usage] `label` Display the disk volume label
`label [drive letter] [volume label name]` Set the volume label of the specified disk
[Example] `C:\>label??`
Volume in drive C is WANG
Volume Serial Number is 2116-1DD0
volume label (11 characters,Enter for none)?
You can enter the volume label, press Enter directly
Delete current volume label (Y/N)?
Press y to delete the old volume label, press n to not change
- `defrag` Disk defragmentation
[Applicable occasion] The disk has been read and written many times, or the disk has been used for a long time. You may need to use this command to defragment the disk. Disk fragmentation does not mean that the disk is broken, but just because after multiple copies and deletions of files, the disk usage will be very fragmented, resulting in slower speed.
[Usage] 1. `C:\>defrag??`
2. Select the disk to be defragmented
3. The computer analyzes the disk status, then tells us how much needs to be defragmented. Press the Esc key
4. Select Optimization Method (disk optimization method), select "Optimize all" or "Optimize only files"
5. Select Begin Optimization to start defragmentation
6. After defragmentation is complete, press Enter
7. Press Esc to exit.
`doskey` Call and create DOS macro commands
[Applicable occasion] When you often need to enter repeated commands, it is very useful
[Usage] `doskey`
Resident `doskey` in memory, open a buffer, and the commands entered later will be saved in the buffer and can be called at any time
`doskey [macro command name]=[command name]`
Define the macro command as a command, and later enter the macro command, the computer will execute the corresponding command
`doskey /reinstall` Reinstall `doskey`
`doskey /bufsize= ` Set the size of the buffer
`doskey /macros` Display all `doskey` macros
`doskey /history` Display all commands in memory
`doskey /insert|overstrike` Set whether the newly typed characters overwrite the old characters
[Example] `C:\>DOSKEY??`
`C:\>dir`
`C:\>copy C:\temp\*.* a:`
`C:\>del c:\temp\*.*`
`C:\>copy b:\*.* c:\temp`
The above four commands have all been saved. You can use the up and down cursor control keys to select and use or modify them one by one. You can also use the F7 key to list all saved commands
`C:\>doskey di=dir/w/p??` Define di as a macro command, which means to execute dir/w/p
- `fdisk` Hard disk partitioning
[Suggestion] Only when the hard disk is severely infected by a virus, or a new hard disk needs to be partitioned. It is best to ask someone who understands to guide. The hard disk needs to go through three steps: low-level formatting, partitioning, and formatting before it can be used. The hard disks in finished computers have already been processed.
[Usage] Enter `fdisk` and press Enter to enter the prompt interface
- `emm386` Extended memory management
[Suggestion] This command is more complicated and will be introduced in detail in the system configuration in Chapter 5
`lh/loadhigh` Load the program into the upper memory
[Applicable occasion] This command is generally used in autoexec.bat. When some software requires a large amount of basic memory, it will be useful
[Usage] `lh [program]`
Load the program into the upper memory. When using this command, the following two statements need to be in the config.sys file. `device=emm386.exe dos=umb`
`lh [program] /l:area number` Load the program into the specified umb area
`lh /s` Generally dedicated by memmaker
[Example] `C:\MOUSE\>lh mouse??` Load the mouse driver program into the upper memory
- `memmaker` Memory optimization management
[Applicable occasion] This command is now rarely used. When DOS was popular in those days, if you wanted to play games, you couldn't do without it. It can free up a lot of basic memory for games, and it only needs to be installed once
[Usage] 1. `C:\>memmaker??`
2. Press Enter to continue, F3 to exit
3. Select manual installation and automatic installation. Press Enter directly to indicate automatic installation (just press Enter)
4. Select whether there are programs that need to expand memory. You can use the space bar to select. Yes means yes, No means no, and press Enter.
5. The program automatically detects whether WINDOWS is installed in the hard disk
6. If there is a floppy disk in the floppy drive, you should take it out, then press Enter, and the computer will restart twice. Do not interrupt, just press Enter.
(In fact, it's very simple, just keep pressing Enter, heh heh)
- `msd` System detection
[Applicable occasion] Used to check system information
[Usage] 1. `C:\>msd` After pressing Enter, you can see the following screen, and annotations are added next to each option to indicate the function of the button
?? 2. Select the project to be queried. For example, select the first Computer, and a dialog box will pop up to display some basic information of the computer. You can try other options to see what they are used for.
3. After activating the drop-down menu by pressing Alt+F key, select the "Exit" item to exit.
- `undelete` Restore deleted files
[Applicable occasion] When you accidentally delete the wrong file, it can be used.
When DOS deletes a file, it only removes the file from the allocation table and deletes the first letter of the file name in the disk storage area. The file content is not immediately deleted from the disk, so it can be recovered.
[Usage] `undelete` Restore deleted files
`undelete /all` Restore files and do not ask again whether to restore,
The first letter is in the order of "#%&-0123456789abcdefghijklmnopqrstuvwxyz" to restore the file
`undelete /list` List recoverable file names
`undelete /s` Can resident `undelete` in memory, but almost no one uses it like this
`prompt` Set prompt
[Applicable occasion] When you are tired of the prompt of c:\> or you want to make your prompt different, you can give it a try. It is a very interesting DOS command that can display the time and date at any time.
[Usage] `prompt $p$g` Use the current directory name and > sign as the prompt, which is the most commonly used prompt
`prompt $t` means time `prompt $d` means date
`prompt $$` means $ `prompt $q` means =
`prompt $v` means current version `prompt $l` means <
`prompt $b` means | `prompt $h` means backspace character
`prompt $e` means the character represented by Esc `prompt $_` means carriage return and line feed
[Example] `C:\DOS>prompt wang$g??` Set wang> as the prompt
`WANG>prompt $t$d$g??` Use time, date and > sign as the prompt
`0:01:07.77Thu 08-29-1996>prompt $p$g??`
`C:\DOS> `
- `restore` Restore backed up files
[Suggestion] If you have backed up files with backup before, you can use it to restore files when the original file is damaged.
Restore the files in the disk backed up with the backup command to another disk. There should be two files backup.00X and control.00X in the backup disk.
[Usage] `restore [backup drive letter] [target drive letter]`
Restore the backup files on the backup disk to the specified disk
`restore /s` Restore backup files including subdirectories to the specified disk
`restore /p` Let the user judge whether to restore the file
`restore /b: date` Restore files before the date
`restore /a: date` Restore files after the date
`restore /l: time` Restore files before the time
`restore /e: time` Restore files after the time
`restore /m` Only restore files modified after the last backup
`restore /n` Only restore files deleted after the last backup
`restore /d` Only display the file names to be restored
[Example] `C:\DOS>restore a: c:??`
Insert backup diskette 01 in drive A:
Press any key to continue . . .
Put the first backup disk in drive A, press any key, and after restoring the first one, put the other disks in order.
When the above command cannot restore the file correctly, please use:
`C:\DOS>restore a: c:\ /s??`
`time` Display and modify time
[Applicable occasion] Used to display and modify time, the usage is the same as date
[Example] `C:\\DOS>time??`
Current time is 12:15:26.04a
Enter new time: 11:20:20.00p
Enter the time in the order of hour: minute, and then add afternoon (a/p). Press the ENTER key directly to ignore the modification time.
- `set` Set environment variables
[Applicable occasion] Used when setting up sound cards and paths, etc.
[Usage] `set [environment variable]=[string]`
This command is often used in autoexec.bat
[Example] `C:\>set blaster=a220 i5 d1` Set the parameters of the sound card
`C:\>set path=c:\dos` The meaning of path c:\dos is the same
- `smartdrv` Set disk accelerator
[Suggestion] It can improve the hard disk access speed. It is best to load it in the autoexec.bat file.
[Usage] `smartdrv /x`
Execute and resident in memory, open the disk acceleration cache area, and shield all drive caches. This is a more commonly used method (usually this command is enough)
`smartdrv /c` Write all information in the cache to the hard disk
`smartdrv /e: number` Set the amount of information moved at one time
`smartdrv /b: number` Set the size of the pre-read buffer
`append` Set the path of non-executable files
[Applicable occasion] When you can't find the manuscript you entered in multiple directories, you can give this command a try. The usage is similar to path.
[Usage] `append [path];[path]`
[Example] `C:\>append c:\test??`
Set the path to find non-executable files to c:\\test. If there is a file 1.txt in this directory, when 1.txt is not found in other directories, it can be automatically found in the c:\\test directory.
`D:\UCDOS>edit 1.txt` can find the C:\test\1.txt file
- `debug` Program debugging command
[Suggestion] If you have learned assembly language, then you should be able to use debug. If you haven't learned it, it's better not to use it
[Usage] `debug [file name]`
- `diskcomp` Compare disks
[Applicable occasion] Compare whether two disks are the same. I don't know when it will be used. When comparing two disks copied with diskcopy, why not use diskcopy/v to verify?
[Usage] `diskcomp [drive letter 1] [drive letter 2]` Compare disk 1 and disk 2
`diskcomp /1` Compare only the first side of the disk
`diskcomp /8` Compare only the first 8 sectors of each track
[Example] `C:\>diskcomp a: a:`
Compare two disks in the same floppy drive
Insert FIRST diskette in drive A:
Put the first disk
Press any key to continue . . .
Comparing 80 tracks 18 sectors per track, 2 side(s)
Insert SECOND diskette in drive A:
Put the second disk
Press any key to continue . . . Compare OK
No difference found in comparison
Compare another diskette (Y/N) ?n
Whether to compare other disks, select y to continue comparing, select n to stop
- `expand` Decompression tool
[Applicable occasion] There are many compressed files with suffixes ending with "_" in the original installation disk of Microsoft software. You can use it to decompress and get rid of the trouble caused by the loss of a few files.
[Usage] `expand [source file name] [destination file]`
[Example] `C:\>expand a:vsafe.co_ c:\dos\vsafe.com`
?妗〗庋?vsafe.co_ is the vsafe.com file
Microsoft (R) File Expansion Utility Version 2.10 Copyright (C) Microsoft Corp 1990-1993. All rights reserved.
Expanding a:vsafe.co_ to c:\dos\vsafe.com. a:vsafe.co_:33046 bytes expanded to 62576 bytes, 89% increase.
`C:\DOS> `
- `fasthelp` Quickly display help information
[Suggestion] You can see all the commands. For a single command, it is not as convenient as adding the /? parameter after the command name
[Usage] `fasthelp` List the uses of all DOS commands
`fasthelp [command name]` Display the use of the command, equivalent to [command name]/?
- `fc` File comparison
[Suggestion] Maybe it will never be used by most people
[Usage] `fc [file name 1] [file name 2]` Compare the differences between the two files. Parameters also include: a c l Lbn n t w nnnn
[Example] `C:\TEST>fc a.bat b.bat??`
Comparing files A.BAT and B.BAT
***** A.BAT
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag
if errorlevel 2 goto mem
if errotlevel 1 goto end
***** B.BAT choice /c:dme defrag,mem,end
***** C:\TEST>
- `interlnk` Start simple network client
[Applicable occasion] If there are two computers, they can be connected into a simple network with it and intersvr. This is a very useful command, but it is not commonly used
[Usage] DOS newly supports network functions,
It can connect two computers through a parallel port cable or serial port cable to form a simple network. To use interlnk, you must add a sentence to config.sys:
`device=c:\dos\interlnk`
Both ends of the parallel port cable should be 25-pin male connectors. The connections between the pins are as follows: corresponding
p2------------------------p15
p3------------------------p13
p4------------------------p12
p5------------------------p10 Male connector means the connector is with pins
p6------------------------p11 Female connector means the connector is with holes
p15-----------------------p2
p13-----------------------p3
p12-----------------------p4
p10-----------------------p5
p11-----------------------p6
p25-----------------------p25 Ground
[Example] `C:\DOS\>interlnk Port-LPT1`
this Computer Other Computer
(Client) (Server)
----------------------------------------
E: equals A:
F: equals C:
In the client, drive E is the server's drive A, and drive F is the server's drive C
- `intersvr` Start simple network server
[Applicable occasion] Using it, the computer becomes a server (only for the simple network provided by DOS)
[Usage] `intersvr` Start the server
`intersvr /lpt:1` Start the server, use lpt1 port as the data transmission port
`intersvr /com:1` Start the server, use com1 port as the data transmission port
Parameters also include x baud: b v rcopy (see interlnk)
[Example] `C:\DOS>intersvr??`
- `qbasic` Start Basic integrated environment
[Suggestion] Maybe it will never be used by most people
[Usage] If you know qbasic language, then you can use it to write your own program. edit.com must have it to be available.
`qbasic` Start the basic language environment
`qbasic/editor` Edit the language in full screen
Parameters also include: b g h mbf nohi run
[Example] `C:\DOS>qbasic??`
- `setver` Set version
[Applicable occasion] When you want to use the commands of other versions of DOS, you can use it to deceive the computer. In high-version DOS, when some old-version programs need DOS3.3, you can use setver to set
[Usage] Generally, add `device=setver.exe` to config.sys when using
`setver` Display the version of the file
`setver [file name] n.nn` Set the version number of the specified file
[Example] `C:\DOS>setver??`
KERNEL.EXE 5.00
DOSOAD.SYS 5.00
EDLIN.EXE 5.00
BACKUP.EXE 5.00
ASSIGN.COM 5.00
EXE2BIN.EXE 5.00
JOIN.EXE 5.00
RECOVER.EXE 5.00
WINWORD.EXE 4.10
`C:\> `
If the program AAA.exe must be executed under MS-DOS3.3, then type
`C:\DOS>setver aaa.exe 3.30??`
For example, net5.exe only runs under MS-DOS5.0, then after adding `device=setver.exe` in config.sys, it can also run under Ms-DOS6.22.
- `share` File sharing
[Suggestion] Only use it when the software declares that it must be run
[Usage] You can add `install=share.exe` to config.sys, or you can directly run the parameters with f l
- `subst` Path replacement
[Suggestion] A very interesting command, which may be useful if you often use CD-ROM software.
[Usage] `subst` Display the current alternative path
`subst [drive letter] [path]`
Replace the specified path with the drive letter, and this path will be used as the drive
`subst /b` Remove the substitution
[Example] `C:\DOS>subst a: c:\temp??` Replace the c drive temp directory with drive a
`C:\>subst a: /d?妗 〗獬?substitution
- `tree` Display command tree structure
[Applicable occasion] View all subdirectories
[Usage] `tree [drive letter]` Display all subdirectory trees
`tree /f` Display file names while displaying directories
`tree /a` Display directory tree in ASCII code
[Example] `C:\WINDOWS>tree /a??`
- `unformat` Restore formatted disk
[Suggestion] You formatted the floppy disk with important information? Quickly use unformat... What? You used format /u, then it's dead
[Usage] `unformat [drive letter]` Restore the specified formatted disk
`unformat /l` Display the file names found by unformat
[Example] `C:\WINDOWS>unformat a:??`
- `vsafe` Virus protection program
[Suggestion] Loading it into memory can detect many kinds of viruses at any time, which is relatively useful.
[Usage] `vsafe` Load vsafe in memory
`vsafe /u` Remove vsafe from memory
`vsafe/ne` Load vsafe into extended memory
`vsafe/nx` Load vsafe into expanded memory
Parameters also include Ax Cx n d
[Example] `C:\>vsafe`
- `ver` Display DOS version
[Example] `C:\>ver`
??MS-DOS Version 6.22
`C:\> `
- `vol` Display the specified disk volume label
[Example] `C:\>vol??`
Volume in drive C is Wang
Volume Serial Number is 2116-1DD0
`C:\> `
- `ctty` Change control device
[Suggestion] Used to change the input
Output device, you can try this command, but I'm afraid it won't have any effect. It is one of the most useless commands in DOS
[Usage] `ctty [device name]` Set the console
[Example] `C:\>ctty aux??` Set aux as the input and output device.
Introduced so many commands, is it dazzling? The key to learning DOS is to practice various commands more, but I have to remind you that some commands need to be careful, otherwise you will regret it later.
- `del *.*` Delete all files in the current directory
[Suggestion] Using `del *.*` in the root directory of drive C will make the computer unable to find the mouse, CD-ROM, unable to use windows, and even unable to start. In fact, when using this command in any directory, you need to think carefully.
- `deltree *.*` Delete all directories and files under the current directory
[Suggestion] When using this command in the root directory of drive C, you must make sure that your mind is clear, and you are sure that this is necessary, but we think that you should not use this command in any case. Using `deltree *.*` in any directory will produce the same or even worse results as `del *.*`. Be careful! Be careful!
- `format c:/u` Format drive C
[Suggestion] Unless your hard disk is deeply infected by a virus, or a real computer expert tells you that you should do this, do not format drive C. It will make you lose all information and take several hours to reinstall all software.
- `fdisk` Hard disk partitioning
[Suggestion] When partitioning the hard disk, be sure to let someone who has used this command to help you use it, otherwise you will lose all information and even be unable to use the hard disk.
- `recover` Overwrite disk
[Suggestion] This command is no longer available after DOS 6. If you are using an old version of DOS, it is advised that you do not use it at any time. It has no other effect except to destroy all information on your hard disk.
