![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-13 03:53 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » Tutorial on Complete DOS Commands |
| Printable Version 1,769 / 13 |
| Floor1 liu00700 | Posted 2007-12-03 20:39 |
| 新手上路 Posts 4 Credits 10 | |
|
I am deeply passionate about batch processing, but I'm not very proficient in it..... I also want to contribute a little to this site. This article is a bit superficial, please forgive me, experts~~~~
DOS Command Encyclopedia Tutorial Section 1. Most Commonly Used Commands ------------------------------- cd Change current directory sys Make DOS system disk copy Copy file del Delete file deltree Delete directory tree dir List file names diskcopy Copy disk edit Text edit format Format disk md Create subdirectory mem View memory status type Display file content rd Delete directory ren Change file name How much do you remember? If you forget, go to class and have a look. The following four commands are new. Give the command format, and you can try it yourself. Learning computers is important, which is to explore. cls Clear screen [Applicable Occasions] The screen is too messy, or there is garbled code on the screen. Clear the content displayed on the screen without affecting any internal information of the computer [Usage] cls Press Enter move Move file, change directory name [Applicable Occasions] Move file to another directory [Usage] move [file name] [directory] Move file to 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:\temp Move the config.sys file to the old directory more Display in pages [Applicable Occasions] When the output is too much to be displayed in one screen, it is applicable. It is almost applicable to all commands, especially when using commands like type. When using more, the disk should not be write-protected, and it is not suitable for CD-ROM drives. [Usage] type [file name] | more Display file content in pages more < [file name] Display file content in pages [Example] C:\>type msdos.w40 | more xcopy Copy directory and file [Applicable Occasions] It is very useful when copying together with subdirectories. 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 its subdirectories to the destination directory xcopy *.* [directory] /s Copy files and non-empty subdirectories to the specified directory Other commonly used parameters also include: v Copy and verify later, which will affect the speed e Similar to s, but even if the subdirectory is empty, it will be copied. Section 2. Relatively Commonly Used Commands ------------------------------------- attrib Set file attributes [Applicable Occasions] When you want to make special processing on files [Usage] attrib Display 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 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 Occasions] Want to know or modify time and date [Usage] date Display and change 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 modifying the date lable Set volume label [Applicable Occasions] Used to make a mark for the disk [Usage] label Display 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. After pressing 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 Occasions] 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 fragments do not mean that the disk is broken, but just because after many copies and deletions of files, the disk usage will be very incohesive, resulting in slow speed. [Usage] 1. C:\>defrag 2. Select the disk to be defragmented doskey Call and create DOS macro commands [Applicable Occasions] When you often need to enter repeated commands, it is very useful [Usage] doskey Resident DOSKEY in memory, open the 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. Later, when you 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 select and use or modify them one by one by using the up and down keys of the cursor control keys. 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 infected by a very powerful virus, or a new hard disk needs to be partitioned. It is best to ask someone who knows about it 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 ready-made 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 program into upper memory [Applicable Occasions] 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 used by memmaker specially [Example] C:\MOUSE\>lh mouse Load the mouse driver program into the upper memory memmaker Memory optimization management [Applicable Occasions] This command is rarely used now. 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 to use. You only need to install it 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 is a program that needs to expand memory. You can select with the space bar. Yes means yes, No means no, 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, take it out, then press Enter, the computer will restart twice, do not interrupt, just press Enter. (In fact, it's very simple, just keep pressing Enter, hehe) msd System detection [Applicable Occasions] Used to check system information [Usage] 1. C:\>msd After pressing Enter, you can see that there are annotations next to each option, indicating the function of the button 2. Select the project to be queried. For example, select the first Computer, a dialog box will pop up showing some basic information of the computer. You can try other options to see what they are for. 3. After activating the drop-down menu by pressing Alt+F key, select the "Exit" item to exit. undelete Recover deleted files [Applicable Occasions] When you accidentally delete the wrong file, it can be used. When DOS deletes a file, it just removes the file from the allocation table, deletes the first letter of the file name in the disk storage area, and the file content is not immediately deleted from the disk, so it can be recovered. [Usage] undelete Recover deleted files undelete /all Recover files and no longer ask whether to recover, The first letter is in the order of "#%&-0123456789abcdefghijklmnopqrstuvwxyz" undelete /list List recoverable file names undelete /s Can keep undelete in memory, but almost no one uses it like this prompt Set prompt [Applicable Occasions] 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 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 indicates time prompt $d indicates date prompt $$ indicates $ prompt $q indicates = prompt $v indicates current version prompt $l indicates < prompt $b indicates | prompt $h indicates backspace character prompt $e indicates the character represented by Esc prompt $_ indicates 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 made file backups 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 name 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 correctly restore the file, please use: C:\DOS>restore a: c:\ /s time Display and modify time [Applicable Occasions] 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 ENTER directly to ignore modifying the time. set Set environment variables [Applicable Occasions] Used when setting 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 sound card parameters 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 reside in memory, open the disk acceleration cache area, and shield all drive caches. This is a 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 Section 3. Uncommonly Used Commands ----------------------- append Set path of non-executable files [Applicable Occasions] 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 as c:\test. If there is a file 1.txt in this directory, when it 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, 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 Occasions] Compare whether two disks are the same. I can't think of 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 drive 1 and drive 2 diskcomp /1 Only compare the first side of the disk diskcomp /8 Only compare 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 Unzip tool [Applicable Occasions] There are many compressed files with suffixes ending with "_" in the original installation disks of Microsoft software. You can use it to unzip and solve 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 Unzip vsafe.co_ to 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 have a look at all 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 Occasions] If there are two computers, they can be connected into a simple network with it and intersrv. 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 a serial port cable to form a simple network To use interlnk, you must add a sentence in config.sys: device=c:\dos\interlnk Both ends of the parallel port cable should be 25-pin male connectors. The connection between the pins is as follows: corresponding p2------------------------p15 p3------------------------p13 p4------------------------p12 p5------------------------p10 Male connector refers to the connector with pins p6------------------------p11 Female connector refers to the connector with holes p15-----------------------p2 p13-----------------------p3 p12-----------------------p4 p10-----------------------p5 p11-----------------------p6 p25-----------------------p25 Ground wire [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 same as drive A of the server, and drive F is the same as drive C of the server intersvr Start simple network server [Applicable Occasions] 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 (refer to 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 usable. qbasic Start basic language environment qbasic/editor Edit language in full screen Parameters also include: b g h mbf nohi run [Example] C:\DOS>qbasic setver Set version [Applicable Occasions] 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 in 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 run it [Usage] You can add install=share.exe in config.sys or run it directly. Parameters include f l subst Path substitution [Suggestion] A very interesting command. If you often use CD-ROM software, it may be useful. [Usage] subst Display the current alternative path subst [drive letter] [path] Substitute the specified path for the drive letter, and this path will be used as a drive subst /b Remove the substitution [Example] C:\DOS>subst a: c:\temp Substitute the temp directory of drive C for drive A C:\>subst a: /d Remove the substitution tree Display command tree structure [Applicable Occasions] 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 Recover 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] Recover 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 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 and output devices of the control. 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 |
|
| Floor2 zhuiyiwxts | Posted 2007-12-03 23:57 |
| 新手上路 Posts 3 Credits 6 | |
| Floor3 hy00hy | Posted 2007-12-04 12:43 |
| 新手上路 Posts 3 Credits 6 | |
|
Thanks a lot. It would be great to have more such kind people on the forum.
|
|
| Floor4 hzc1983 | Posted 2007-12-05 18:59 |
| 新手上路 Posts 1 Credits 2 | |
|
Brother, please post more posts like this in the future! Hehe!
|
|
| Floor5 fydncom | Posted 2007-12-06 16:38 |
| 初级用户 Posts 12 Credits 26 | |
| Floor6 58795362 | Posted 2007-12-07 14:29 |
| 初级用户 Posts 16 Credits 33 | |
|
Are there any unpublicized DOS commands to share?
|
|
| Floor7 maclover815 | Posted 2007-12-11 23:38 |
| 初级用户 Posts 47 Credits 92 | |
| Floor8 liumingqing | Posted 2007-12-12 18:07 |
| 初级用户 Posts 73 Credits 136 | |
|
Very detailed tutorial. Thanks for providing!
|
|
| Floor9 jsychuazai | Posted 2007-12-15 12:43 |
| 新手上路 Posts 1 Credits 2 | |
| Floor10 yulanggongwu | Posted 2007-12-16 20:37 |
| 初级用户 Posts 15 Credits 27 | |
| Floor11 sevensecond | Posted 2008-01-13 14:16 |
| 初级用户 Posts 14 Credits 41 | |
|
These commands can also be found in the CMD under Windows. Are there any other commands? If anyone knows, please complete them. Thanks in advance.
|
|
| Floor12 mydelan | Posted 2008-01-13 14:30 |
| 初级用户 Posts 14 Credits 26 | |
|
Learned. Hehe, support the owner's technical post
|
|
| Floor13 zyz0304360 | Posted 2008-01-13 17:49 |
| 中级用户 Posts 123 Credits 257 From 烟台 | |
|
Learning
|
|
| Floor14 sbkkkiw | Posted 2008-01-15 04:24 |
| 新手上路 Posts 8 Credits 16 | |
|
I don't even understand how to install DOS at all!! How can I learn commands then!
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |