Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is a compilation of verified information from the various answers and cited references in this thread:</p> <ol> <li><code>command.com</code> is the 16-bit command processor introduced in MS-DOS and was also used in the Win9x series of operating systems.</li> <li><code>cmd.exe</code> is the 32-bit command processor in Windows NT (64-bit Windows OSes also have a 64-bit version). <code>cmd.exe</code> was never part of Windows 9x. It originated in OS/2 version 1.0, and the OS/2 version of <code>cmd</code> began 16-bit (but was nonetheless a fully fledged protected mode program with commands like <code>start</code>). Windows NT inherited <code>cmd</code> from OS/2, but Windows NT's Win32 version started off 32-bit. Although OS/2 went 32-bit in 1992, its <code>cmd</code> remained a 16-bit OS/2 1.x program.</li> <li>The <code>ComSpec</code> env variable defines which program is launched by <code>.bat</code> and <code>.cmd</code> scripts. (Starting with WinNT this defaults to <code>cmd.exe</code>.)</li> <li><code>cmd.exe</code> is backward compatible with <code>command.com</code>.</li> <li>A script that is designed for <code>cmd.exe</code> can be named <code>.cmd</code> to prevent accidental execution on Windows 9x. This filename extension also dates back to OS/2 version 1.0 and 1987.</li> </ol> <p>Here is a list of <code>cmd.exe</code> features that are not supported by <code>command.com</code>:</p> <ul> <li>Long filenames (exceeding the 8.3 format)</li> <li>Command history</li> <li>Tab completion</li> <li>Escape character: <code>^</code> (Use for: <code>\ &amp; | &gt; &lt; ^</code>)</li> <li>Directory stack: <code>PUSHD</code>/<code>POPD</code></li> <li>Integer arithmetic: <code>SET /A i+=1</code></li> <li>Search/Replace/Substring: <code>SET %varname:expression%</code></li> <li>Command substitution: <code>FOR /F</code> (existed before, has been enhanced)</li> <li>Functions: <code>CALL :label</code></li> </ul> <p>Order of Execution:</p> <p>If both .bat and .cmd versions of a script (test.bat, test.cmd) are in the same folder and you run the script without the extension (test), by default the .bat version of the script will run, even on 64-bit Windows 7. The order of execution is controlled by the PATHEXT environment variable. See <a href="https://stackoverflow.com/questions/605101/order-in-which-command-prompt-executes-files-with-the-same-name-a-bat-vs-a-cmd-v">Order in which Command Prompt executes files</a> for more details.</p> <p>References:</p> <ul> <li><a href="http://www.ss64.com/ntsyntax/" rel="noreferrer">cmd.exe</a></li> <li><a href="http://gregvogl.net/courses/os/handouts/doscmdref.pdf" rel="noreferrer" title="PDF">command.com</a></li> </ul> <p>wikipedia: <a href="http://en.wikipedia.org/wiki/Comparison_of_computer_shells" rel="noreferrer">Comparison of command shells</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload