List of MS-DOS Commands - Wikipedia, the Free Encyclopedia Page 1 of 25
Total Page:16
File Type:pdf, Size:1020Kb
List of MS-DOS commands - Wikipedia, the free encyclopedia Page 1 of 25 List of MS-DOS commands From Wikipedia, the free encyclopedia In the personal computer operating systems MS -DOS and PC DOS, a number of standard system commands were provided for common Contents tasks such as listing files on a disk or moving files. Some commands were built-in to the command interpreter, others existed as transient ■ 1 Resident and transient commands commands loaded into memory when required. ■ 2 Command line arguments Over the several generations of MS-DOS, ■ 3 Windows command prompt commands were added for the additional ■ 4 Commands functions of the operating system. In the current ■ 4.1 @ Microsoft Windows operating system a text- ■ 4.2 : mode command prompt window can still be ■ 4.3 ; used. Some DOS commands carry out functions ■ 4.4 /* equivalent to those in a UNIX system but ■ 4.5 ( ) always with differences in details of the ■ 4.6 append function. ■ 4.7 assign ■ 4.8 attrib ■ 4.9 backup and restore Resident and transient ■ 4.10 BASIC and BASICA commands ■ 4.11 call ■ 4.12 cd or chdir ■ 4.13 chcp The command interpreter for MS-DOS runs ■ 4.14 chkdsk when no application programs are running. ■ 4.15 choice When an application exits, if the command ■ 4.16 cls interpreter in memory was overwritten, MS- ■ 4.17 copy DOS will re-load it from disk. The command ■ 4.18 ctty interpreter is usually stored in a file called ■ 4.19 defrag "COMMAND.COM". Some commands are ■ 4.20 del or erase internal and built-into COMMAND.COM, ■ 4.21 deltree others are stored on disk in the same way as ■ 4.22 dir application programs. When the user types a ■ 4.23 echo line of text at the operating system command ■ 4.24 edit prompt, COMMAND.COM will parse the line, ■ 4.25 edlin and attempt to match a command name to a ■ 4.26 exe2bin built-in command or to the name of an ■ 4.27 exit executable program file or batch file on disk. If ■ 4.28 extproc no match is found, an error message is printed [1] ■ 4.29 fastopen and the command prompt is refreshed. ■ 4.30 fc or comp ■ 4.31 fdisk Resident commands varied slightly between ■ 4.32 find revisions of MS-DOS. Typically, the functions ■ 4.33 for DIR (list directory), ERASE or DEL (erase a ■ 4.34 format file or directory), COPY (copy files), DATE ■ 4.35 help (display or set date), TIME (display or set ■ 4.36 intersvr & interlnk time), CD (change working directory), MD ■ 4.37 join (make a directory on the current disk), REN ■ 4.38 label (rename a file or directory) and some others ■ 4.39 loadfix were resident in COMMAND.COM. ■ 4.40 loadhigh, lh http://en.wikipedia.org/wiki/List_of_MS-DOS_commands 19-11-2011 List of MS-DOS commands - Wikipedia, the free encyclopedia Page 2 of 25 Transient commands were too large to keep in ■ 4.41 md or mkdir the command processor, or were less frequently ■ 4.42 mem used. Such utility programs would be stored on ■ 4.43 memmaker disk and loaded just like regular application ■ 4.44 mode programs, but were distributed with the ■ 4.45 more operating system. Copies of these utility ■ 4.46 move command programs had to be on an accessible ■ 4.47 msd disk, either on the current logged-in floppy ■ 4.48 path drive or on the command path set in the ■ 4.49 pause command interpreter. ■ 4.50 pcpark ■ 4.51 print A special type of external, transient command ■ 4.52 readline is the batch file, containing a set of commands ■ 4.53 rd or rmdir that are processed as if entered at the command ■ 4.54 rem line. Some additional keywords are recognized ■ 4.55 ren by the command interpreter COMMAND.COM ■ 4.56 scandisk to make batch files more useful. These ■ 4.57 set commands aren't useful if typed in interactively ■ 4.58 setver at the command prompt, but allow flexible ■ 4.59 share processing by a batch file. ■ 4.60 smartdrive ■ 4.61 sort Command line arguments ■ 4.62 subst ■ 4.63 sys ■ 4.64 time and date Main article: Command-line interface ■ 4.65 tree In the list below, commands that can accept ■ 4.66 truename more than one filename, or a filename including ■ 4.67 type wildcards (* and ?), are said to accept a ■ 4.68 undelete ■ 4.69 ver filespec parameter. Commands that can accept only a single filename are said to accept ■ 4.70 verify ■ 4.71 xcopy a filename parameter. Additionally, zero or more command line switches, or other ■ 5 See also parameter strings, can be supplied on the ■ 6 References command line. Spaces, and symbols such as a ■ 7 External links "/" or a "-" may be used to allow the command processor to parse the command line into file names, file specifications, and other options. In DOS commands, unlike Unix, lower-case and capital letters are equivalent for file name specifiers; DOS commands preserve case, but do not require file specifiers to Parts of an MS-DOS command line, match case. Often parameters or arguments are also showing a system prompt, command independent of case, especially in those programs developed and command line arguments, drive only for DOS. Utility programs that also have versions running under UNIX-like operating systems often use upper letters, file spec with wildcard and lower case arguments to mean different things. character and command line switches. Sometimes a hyphen ("-") may be used instead of a slash ("/"); very early versions of DOS made the setting of the delimiter character a user-controlled option. Commands which are not built into the command interpreter may follow the same conventions. http://en.wikipedia.org/wiki/List_of_MS-DOS_commands 19-11-2011 List of MS-DOS commands - Wikipedia, the free encyclopedia Page 3 of 25 For some commands, a UNIX command with similar functions is given. Comparisons are approximate. While many commands are the same across many DOS systems (MS-DOS, PC DOS, DR-DOS, FreeDOS, etc.) some differ in command syntax or name. Windows command prompt Microsoft Windows supports a number of commands which may be invoked by typing them in a command window; they are usually similar to their MS-DOS equivalents. Typing help followed by a carriage return at a command prompt will list the commands. File and path names used as arguments may be long, unlike MS-DOS names in "8.3" form, and may contain embedded spaces; names with spaces must be enclosed between a pair of double-quote character ("). Two command-line interfaces can be used in original DOS systems. Since this 16-bit executable is based on the DOS command.com, it does not support all the extended file-name syntax of Windows. Commands A partial list of the most common commands for MS-DOS follows. @ Commands beginning with the @ command are never echoed before running. The main use is to prevent batch echo by placing a command @echo off at the beginning of batch files. : A colon in front of a word, like :label , designates a label. Unlike remarks (REM), labels are not processed by the command processor, so comments might be added proceeded by a pair of colons, eg ::, or by a colon and space. ; Semicolons at the beginning of the line are usually processed by the command processor, but most other programs ignore these. This might be used to add a small batch file to the beginning of a program's data file, in the way that EXTPROC works. /* In PC DOS, OS/2 thus 4OS2, 4DOS, 4NT etc, a batch file beginning with /* is treated as a REXX script. PC DOS 7.0, 2000 and 7.1 implement this feature. In REXX, as in C, comments are surrounded by a matching /* comment */. ( ) Commands surrounded by parenthesis ('(' and ')') are treated as a single command. This is very useful to execute several commands in the same iteration of a FOR loop. append http://en.wikipedia.org/wiki/List_of_MS-DOS_commands 19-11-2011 List of MS-DOS commands - Wikipedia, the free encyclopedia Page 4 of 25 Displays or sets the search path for data files. DOS will search the specified path(s) if the file is not found in the current path. This had some creative uses, such as allowing non-CD based games to be run from the CD, using configuration/save files stored on the hard drive. append; append [d:]path[;][d:]path[...] append [/X:on|off][/E] assign The command redirects requests for disk operations on one drive to a different drive. assign [x[:]=y[:]... assign /STATUS Options: ■ x The drive letter to reassign. ■ y The drive letter that x: will be assigned to. ■ /STATUS Displays the current drive assignments. If typed without parameters then all drive letters are reset to original assignments. The command is available in MS-DOS 5.00. attrib Attrib changes or views the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory. ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H][drive:][path][filename] [/S [/D]] Options: ■ To add an attribute attach a '+' in front of it. ■ To remove an attribute attach a '-' in front of it ■ Attributes include ■ R - Read-only ■ A - Archive ■ S - System ■ H - Hidden ■ /D - Process folders as well. ■ /S - Process matching files in the current folder and all subfolders. Note: Everything inside a brace [option] is an optional item. Roughly equivalent to the Unix commands chattr and lsattr.