List of DOS commands: Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 2409:4089:1D82:8F72:CCCC:A246:CC16:42DE to version by InternetArchiveBot. Report False Positive? Thanks, ClueBot NG. (4203012) (Bot)
m Reverted edit by 109.38.233.140 (talk) to last version by 199.192.1.63
 
(48 intermediate revisions by 34 users not shown)
Line 1:
{{Short description|None}}
{{Use dmy dates|date=May 2019|cs1-dates=y}}
This article presentslists anotable list of[[command (computing)|commands]] usedprovided by the [[MS-DOS]] [[disk operating system]]s (DOS), especially as used on an [[x86IBM PC compatible]]-based [[IBMcomputer]]. PCOther compatibleDOS variants as well as the legacy [[Windows]]s [[shell (PCscomputing)|shell]], [[Command Prompt]] (cmd.exe), provide many of these commands. Many other DOS variants [[List of DOSdisk operating systems#Other operatingcalled systemsDOS|Otherare DOSinformally operatingcalled systems''DOS'']], but are not partincluded ofin the scope of thisthe list. The highly related variant, [[IBM PC DOS]], is included. The list is not intended to be exhaustive, but does include commands covering the various releases.
 
Each command is implemented either as [[shell builtin|built-in]] to the [[command-line interpreter|command interpreter]], [[COMMAND.COM]], or as an external [[computer program|program]]. Although prevailing style is to write command names in all caps, the interpreter matches ignoring case.
In DOS, many standard [[system command]]s were provided for common tasks such as listing files on a disk or moving files. Some commands were built into the command interpreter, others existed as external commands on disk. Over the several generations of DOS, commands were added for the additional functions of the operating system. In the current [[Microsoft Windows]] operating system, a text-mode command prompt window, [[cmd.exe]], can still be used.
 
{{Horizontal TOC|nonum=yes}}
 
==Commands==
==Command processing==
The command interpreter for DOS runs when no application programs are running. When an application exits, if the transient portion of the command interpreter in memory was overwritten, DOS will reload it from disk. Some commands are internal—built into COMMAND.COM; others are external commands stored on disk. When the user types a line of text at the operating system command prompt, COMMAND.COM will parse the line and attempt to match a command name to a built-in command or to the name of an executable program file or [[batch file]] on disk. If no match is found, an error message is printed, and the command prompt is refreshed.
 
External commands were too large to keep in the command processor, or were less frequently used. Such utility programs would be stored on disk and loaded just like regular application programs but were distributed with the operating system. Copies of these utility command programs had to be on an accessible disk, either on the current drive or on the command [[PATH (variable)|path]] set in the command interpreter.
 
In the list below, commands that can accept more than one file name, or a filename including wildcards (* and ?), are said to accept a ''<kbd>[[filespec]]</kbd>'' (file specification) parameter. Commands that can accept only a single file name are said to accept a ''<kbd>filename</kbd>'' parameter. Additionally, command line switches, or other parameter strings, can be supplied on the command line. Spaces and symbols such as a "/" or a "-" may be used to allow the command processor to parse the command line into filenames, file specifications, and other options.
 
The command interpreter preserves the case of whatever parameters are passed to commands, but the command names themselves and file names are case-insensitive.
 
Many commands are the same across many DOS systems, but some differ in command syntax or name.
 
==DOS commands==
A partial list of the most common commands for [[MS-DOS]] and [[IBM PC DOS]] follows below.
 
===APPEND===
Line 89 ⟶ 77:
{{Main|choice (command)}}
 
The CHOICE command is used in batch files to prompt the user to select one item from a set of single-character ''choices''. Choice was introduced as an external command with MS-DOS 6.0;<ref name="RUNNINGMSDOS" /><ref>{{cite web|url=http://www.computerhope.com/choicehl.htm|title=MS-DOS choice command help|access-date=10 September 2014}}</ref> [[Novell DOS]] 7<ref name="drdos7ch7">{{cite web|url=http://www.drdos.com/dosdoc/usergeng/07ugch7.htm|title=Caldera DR-DOS 7.03 User Guide|access-date=10 September 2014|archive-date=2015-09-23 |archive-url=https://web.archive.org/web/20150923220343/http://www.drdos.com/dosdoc/usergeng/07ugch7.htm|url-status=usurped}}</ref> and PC DOS 7.0. Earlier versions of [[DR-DOS]] supported this function with the built-in ''switch'' command (for numeric choices) or by beginning a command with a question mark.<ref name="drdos7ch7" /> This command was formerly called ync (yes-no-cancel).
 
===CLS===
Line 162 ⟶ 150:
Deletes a directory along with all of the files and subdirectories that it contains. Normally, it will ask for confirmation of the potentially dangerous action. Since the RD (RMDIR) command can not delete a directory if the directory is not empty (except in Windows NT & 10), the DELTREE command can be used to delete the whole directory.
 
The <code>deltree</code> command is included in certain versions of [[Microsoft Windows]] and [[MS-DOS]] [[operating system]]s. It is specifically available only in versions of [[MS-DOS]] 6.0 and higher,<ref name="RUNNINGMSDOS" /> and in [[Windows 9x|Microsoft Windows 9x]]. In Windows NT, the functionality provided exists but is handled by the command {{mono|rd}} or {{mono|rmdir}} which has slightly different syntax. This command is not present in Windows 7 and 8. In Windows 10, the command switch is {{kbd|RD /S}} or {{kbd|RMDIR /S}}.
 
===DIR===
Line 212 ⟶ 200:
{{Main|MS-DOS Editor}}
 
EDIT is a full-screen [[text editor]], included with MS-DOS versions 5 and 6,<ref name="RUNNINGMSDOS" /> OS/2 and Windows NT to 4.0. The corresponding program in Windows 95 and later, and Windows 2000 and later is Edit v2.0. PC DOS 6 and later use the [[E (PC DOS)|DOS ''E'' Editor]] and DR-DOS used ''editor'' up to version 7.
 
===EDLIN===
Line 294 ⟶ 282:
===FINDSTR===
The FINDSTR command is a GREP-oriented ''FIND''-like utility. Among its uses is the logical-OR lacking in FIND.
{{sxhl|FINDSTR "YES NO MAYBE" *.txt|dosdosbatch}}
::would find all [[Text file|TXT]] files with one or more of the above-listed words YES, NO, MAYBE.
 
Line 352 ⟶ 340:
 
===INTERSVR and INTERLNK===
{{Main|Interlnk}}
In MS-DOS; <kbd>filelink</kbd> in DR-DOS.
 
Network PCs using a [[null modem]] cable or [[LapLink cable]]. The server-side version of InterLnk, it also immobilizes the machine it's running on as it is an active app (As opposed to a [[Terminate terminate-and-stay-resident Stay Resident|TSRprogram]] app) which must be running for any transfer to take place. DR-DOS' <kbd>filelink</kbd> is executed on both the client and server.
 
New in PC DOS 5.02, MS-DOS 6.0.<ref name="murdock" /><ref name="RUNNINGMSDOS" />
Line 376 ⟶ 365:
 
The command is available in MS-DOS versions 3.1 and later and IBM PC DOS releases 3 and later.<ref name="RUNNINGMSDOS" />
 
=== LASTDRIVE ===
Used in the CONFIG.SYS file to set the maximum number of drives that can be accessed.
 
The command is available in MS-DOS versions 3.0 and later.<ref>{{Cite web |title=DOS Command: LASTDRIVE |url=https://easydos.com/lastdrive.html |access-date=2025-04-05 |website=easydos.com}}</ref>
 
===LINK4===
Line 409 ⟶ 403:
 
=== MEMMAKER ===
Starting with version 6,<ref name="RUNNINGMSDOS" /> MS-DOS included the external program MemMaker which was used to free system memory (especially [[Conventional memory]]) by automatically reconfiguring the [[AUTOEXEC.BAT]] and [[CONFIG.SYS]] files. This was usually done by moving [[Terminate and stay resident program|TSR programs]] and [[device driver]]s to the [[Upper memory area|upper memory]]. The whole process required two system restarts. Before the first restart the user was asked whether to enable [[Expanded memory|EMS Memory]], since use of expanded memory required a reserved 64KiB region in upper memory. The first restart inserted the SIZER.EXE program which gauged the memory needed by each TSR or Driver. MemMaker would then calculate the optimal Driver and TSR placement in upper memory and modify the AUTOEXEC.BAT and CONFIG.SYS accordingly, and reboot the second time.<ref>{{cite book | title = Using MS-DOS 6.22 | first = Jim | last = Cooper | publisher = [[Que Publishing]] | page = 455 | isbn = 0789725738 | date = May 2001 | url = https://books.google.com/books?id=u7oN-5y7nGsC&q=configuring+memory+with+memmaker+cooper&pg=PA455}}</ref>
 
MEMMAKER.EXE and SIZER.EXE were developed for Microsoft by [[Helix Software Company]] and were eliminated starting in [[MS-DOS 7]] ([[Windows 95]]); however, they could be obtained from Microsoft's FTP server as part of the OLDDOS.EXE package, alongside other tools.
Line 459 ⟶ 453:
|date=January 4, 1994}}</ref> There is another offering, named MWBACKUP, that is [[Graphical user interface|GUI]]-oriented. It was introduced for Windows for Workgroups (3.11).<ref>Source: Zeos International: {{cite web
|url=http://windowsbulletin.com/files/exe/zeos-international-ltd/windows-for-workgroups-3-11-ms-dos-6-22-backup-installation-disc/mwbackup-exe
|title=What is MWBACKUP.EXE?|date=25 February 2019 }}</ref>
 
The MSBACKUP command is available in MS-DOS versions 6 and later.<ref name="RUNNINGMSDOS" />
Line 473 ⟶ 467:
{{Main|Microsoft Diagnostics}}
 
The MSD command provides detailed technical information about the computer's hardware and software. MSD was new in MS-DOS 6;<ref name="RUNNINGMSDOS" /><ref>{{cite web|url=http://www.computerhope.com/msdhlp.htm|title=MS-DOS msd command help|access-date=10 September 2014}}</ref> the PC DOS version of this command is QCONFIG.<ref name="pcdosretro-commands">{{Citationcite web needed|last1=Brooks |first1=Vernon |title=List of DOS commands |url=https://pcdosretro.github.io/commands.htm#QCONFIG |website=PC DOS Retro |access-date=December9 2008January 2024 |archive-url=https://archive.today/20240109102327/https://pcdosretro.github.io/commands.htm%23QCONFIG |archive-date=9 January 2024 |url-status=live}} </ref> The command appeared first in Word2, and then in Windows 3.10.
 
=== MSHERC ===
{{Expand section|date=May 2019}}
The MSHERC.COM (also QBHERC.COM) was a TSR (Terminate and Stay Resident) graphics driver supplied with Microsoft QuickC, QuickBASIC, and the C Compiler, to allow use of the Hercules adapter high-resolution graphics capability (720 x 348, 2 colors).<ref>https://www.pcjs.org/pubs/pc/reference/microsoft/kb/Q44273/ {{Dead link|date=February 2022}}</ref>
 
=== NLSFUNC ===
Line 524 ⟶ 518:
{{See also|Prompt (computing)}}
 
The {{mono|PROMPT}} command allows the user to change the prompt in the command screen. The default prompt is {{mono|$p$g}} (i.e. {{kbd|PROMPT $p$g}}), which displays the drive, andthe current path, and a greater than sign ">" as the prompt, but can be changed to anything. {{kbd|PROMPT $d}}, displays the current system date as the prompt. Type {{kbd|PROMPT /?}} in the cmd screen for help on this function.
 
The command is available in MS-DOS versions 2 and later and IBM PC DOS releases 2.1 and later.<ref name="RUNNINGMSDOS" />
Line 562 ⟶ 556:
{{Main|ren (command)}}
 
The REN command renames a file. Unlike the <code>move</code> command, this command cannot be used to rename subdirectories, or rename files across drives. Mass renames can be accomplished by the use of the wildcards characters asterisk (*) and question mark (?).<ref>{{cite web |url=https://technet.microsoft.com/en-us/library/bb490987.aspx |title=Microsoft TechNet Rename (ren) article|date=11 September 2009 }}</ref>
 
The command is available in MS-DOS versions 1 and later.<ref name="RUNNINGMSDOS" />
Line 627 ⟶ 621:
{{See also|ver (command)}}
 
SetVer is a [[Terminate and stay resident program|TSR]] program designed to return a different value to the version of DOS that is running. This allows programs that look for a specific version of DOS to run under a different DOS.
 
The command is available in MS-DOS versions 5 and later.<ref name="RUNNINGMSDOS" />
Line 655 ⟶ 649:
 
=== SORT ===
A [[Filter (software)|filter]] to sort lines in the input data stream and send them to the output data stream. Similar to the Unix command <code>[[Sort (Unix)|sort]]</code>. Handles files up to 64k. This sort is always case insensitive.<ref>{{cite web|url=https://technet.microsoft.com/en-us/library/cc722869.aspx|title=Microsoft on "sort"|date=20 February 2014 |access-date=10 September 2014}}</ref>
 
The command is available in MS-DOS versions 2 and later.<ref name="RUNNINGMSDOS" />
Line 709 ⟶ 703:
{{Main|TYPE (DOS command)}}
 
Displays a file. The <code>[[#MORE|more]]</code> command is frequently used in conjunction with this command, e.g. <code>type ''long-text-file'' | more</code>. TYPE can be used to concatenate files ({{code|type file1 file2 > file3|dosdosbatch}}); however this won't work for large files{{dubious|date=November 2014}}{{citation needed|date=November 2014}}—use copy command instead.
 
The command is available in MS-DOS versions 1 and later.<ref name="RUNNINGMSDOS" />
Line 716 ⟶ 710:
{{Main|Undeletion}}
 
Restores file previously deleted with <kbd>del</kbd>. By default all recoverable files in the working directory are restored; options are used to change this behavior. If the MS-DOS <kbd>mirror</kbd> [[Terminate and stay resident program|TSR]] program is used, then deletion tracking files are created and can be used by <kbd>undelete</kbd>.
 
The command is available in MS-DOS versions 5 and later.<ref name="RUNNINGMSDOS" />
Line 723 ⟶ 717:
{{See also|format (command)}}
 
MS-DOS version 5 introduced the quick format option (<code>Format /Q</code>) which removes the disk's file table without deleting any of the data. The same version also introduced the UNFORMAT command to undo the effects of a quick format, restoring the file table and making all the files accessible again. It is important to note that

UNFORMAT only works if invoked before any further changes have overwritten the drive's contents.<ref name="RUNNINGMSDOS" />
 
=== VER ===
Line 733 ⟶ 729:
 
=== VERIFY ===
Enables or disables the feature to determine if files have been correctly written to disk (You can enable the verify command by typing "verify on" on Command Prompt and pressing enter. To display the current VERIFY setting, type VERIFY without a parameter. To turn off the feature, type "verify off"). If no parameter is provided, the command will display the current setting.<ref>{{cite web|url=http://www.csulb.edu/~murdock/verify.html|title=DOS Command: VERIFY|access-date=10 September 2014}}</ref>
 
The command is available in MS-DOS versions 2 and later.<ref name="RUNNINGMSDOS" />
Line 747 ⟶ 743:
{{Main|MSAV}}
 
A [[Terminate and stay resident program|TSR]] program that continuously monitors the computer for viruses.
 
The command is available in MS-DOS versions 6 and later.<ref name="RUNNINGMSDOS" />
Line 762 ⟶ 758:
== See also ==
* [[:Category:Windows commands]]
* [[Command-line interface]]
* [[List of CONFIG.SYS directives]]
* [[Timeline of DOS operating systems]]
Line 776 ⟶ 771:
{{wikibooks|Guide to Windows Commands}}
*[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands Command-Line Reference] : Microsoft TechNet Database "Command-Line Reference"
*[https://technet.microsoft.com/en-us/library/cc749839.aspx The MS-DOS 6 Technical Reference on TechNet] contains the official Microsoft MS-DOS 6 command reference documentiondocumentation.
*[http://www.drdos.com/dosdoc/ DR-DOS 7.03 online manual] {{Webarchiveusurped|url1=[https://web.archive.org/web/20180821031854/http://www.drdos.com/dosdoc/ |date=2018DR-08-21DOS 7.03 online manual]}}
*[http://www.mdgx.com/secrets.htm MDGx MS-DOS Undocumented + Hidden Secrets]
*[https://github.com/microsoft/MS-DOS MS-DOS v1.25 and v2.0 source code]
 
There are several guides to DOS commands available that are licensed under the [[GNU Free Documentation License]]: