The following are some commonly used ones, please add more, everyone. DOS common commands:
cd - change current directory
sys - make a DOS system disk
copy - copy files del - delete files
deltree - delete a directory tree
dir - list filenames
diskcopy - make disks
edit - text editing
format - format disk
md - create subdirectory
mem - view memory status
type - display file contents
rd - delete directory
ren - change filename
cls - clear screen
move - move files,
more - paged display
xcopy - copy directories and files
help - help
attrib - set file attributes
date - display and modify date
lable - set volume label number
defrag - disk defragmentation
doskey - call and create DOS macro commands
fdisk - hard disk partitioning
emm386 - extended memory management
lh/loadhigh - load a program into upper memory
memmaker - memory optimization management
msd - system detection
undelete - recover deleted files
prompt - set prompt
restore - restore backed-up files
time - display and modify time
set - set environment variables
smartdrv - set disk accelerator
append - set the path for non-executable files
debug - program debugging command
diskcomp - compare disks
expand - extraction tool
fasthelp - quickly display help information
fc - file comparison
interlnk - start the simple network client
intersvr - start the simple network server
qbasic - start the Basic integrated environment
setver - set version
share - file sharing
subst - path substitution
tree - display tree structure
unformat - recover a formatted disk
vsafe - virus protection program
ver - display DOS version
vol - display the specified disk volume label number
ctty - change control device
Commands to use with caution:
del *.* - delete all files in the current directory
deltree *.* - delete all directories and files under the current directory
format c:/u - format drive C fdisk - hard disk partitioning recover - overwrite disk
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Undocumented MS-DOS commands and parameters
Up to MS-DOS version 6.22, many undocumented commands and parameters are still kept. Below is an introduction to these commands and parameters.
1.TRUENAME
When using the SUBST or JOIN command, or when mapping a physical drive to a logical drive on a network, it is used to display the actual physical location of files and directories.
2.FDISK/MBR
Rewrite the hard disk master boot record. Note: if the hard disk has more than four partitions, this command cannot be used, because the area storing extra partition information will be overwritten by FDISK/MBR. (Beginners absolutely must not use it)
3.SHELL=C:\COMMAND.COM/P/F
After adding the /F parameter, when the “Abort,Retry,Fail” error message appears, Fail will be taken as the default option.
4.COMMAND/F
When executed at the command line, it makes Fail the default option for the “Abort,Retry,Ignore,Fail” error prompt until reboot. After executing this command in other dedicated DOS shells (such as NDOS, 4DOS, etc.) or the DOS shells of application programs (such as PCTOOLS, CCED, etc.), it will return to and stay in the MS-DOS shell; you must execute EXIT to return to the second shell.
5.COMMAND/P
When executed at the command line, it reruns AUTOEXEC.BAT. If this command is executed in another DOS shell, it will return to the MS-DOS shell and cannot return to the second shell again.
6.COMMAND/D
When executed at the command line, it prevents automatic batch files from running. When run in another DOS shell, the situation is the same as COMMAND/F, but Fail is not set as the default option.
7.VER/R
Displays more information. For example, executing VER displays “MS-DOS Version 6.22”; after adding the parameter /R, it displays: MS-DOS Version 6.22 Revision A DOS is in HMA
8.FORMAT/AUTOTEST
Automatically checks the disk format, then completes the whole formatting process, and returns to the DOS prompt.
9.FORMAT/BACKUP
Except for prompting the user to enter the volume label, it is the same as above.
10.FORMAT/SELECT
Only backs up the system area data on the disk, equivalent to executing the MIRROR program, without formatting.
11.FORMAT/SELECT/U
Does not format, only fills the boot sector and file allocation table with F6H. Although it does not touch the root directory area and data area, the disk becomes inaccessible because of this. This seems to provide an emergency means of preventing data leakage. (Beginners absolutely must not use it)
12.IF EXIST EMMXXXXO
This command name can be used in batch files to detect whether EMM386.EXE is in memory. Example command line: “if not exist EMMXX XXO echo EMM386.EXE is not installed!”.
13.IF EXIST XMMXXXXO
This command name can be used in batch files to detect whether HIMEM.SYS is loaded in memory. The command line can be: “if not exist XMMXXX XO echo HIMEM.SYS is not in memory!”.
14.COPY . A:
Use “.” in place of “*.*”; it can also be used with commands such as DEL.
15.INSTALLHIGH
Some device drivers need to be installed in CONFIG.SYS with the INSTALL statement, and can only be loaded into conventional memory, and MEMMAKER does not process INSTALL statements when optimizing memory. You can instead use INSTALLHIGH to load such device driver programs into upper memory, for example: INSTALLHIGH=C:\DOS\SHARE.EXE.
16.Use “:” in place of “REM”
When DOS executes a batch file and encounters a “REM” statement, it first reads in the whole line, then decides how to handle it based on whether the line starts with REM; but when it encounters a label beginning with “:”, as long as the second character is not a letter or number, it is treated as an invalid label and it immediately jumps to the next line. Therefore, “:” plus a space can be used to lead comment lines, in order to increase batch file execution speed.