A partial list of the most common commands for MS-DOS follows. @ Commands beginning with the @ command are never echoed before runni...
Command Prompt (executable name cmd.exe) is the Microsoft-supplied command-line interpreter on OS/2, Windows CE and on Windows NT-based oper...
Wednesday, 21 September 2011
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 */.
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.
The command redirects requests for disk operations on one drive to a different drive.
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 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]]
To add an attribute attach a '+' in front of it.
To remove an attribute attach a '-' in front of it
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.
Therese Stowell developed the initial version of cmd.exe for Windows NT. Although some old DOS commands are unsupported or have been changed (ex: the functionality of deltree was rolled into rd in the form of the /s parameter), cmd.exe still has a greater number of built-in commands.
Both the OS/2 and the Windows NT versions of cmd.exe have more detailed error messages than the blanket "Bad command or file name" (in the case of malformed commands) of command.com. In the OS/2 version of cmd.exe, errors are reported in the current language of the system, their text being taken from the system message files. The help command can then be issued with the error message number to obtain further information.
cmd.exe remains part of Windows Vista, Windows Server 2008, and Windows 7