whats the diff between "command.com" and "cmd.exe" ? does xp home have it or just xp pro ?

S

S.Sengupta

CMD.EXE is the Windows NT command line interface, its not a DOS window.
Whereas,COMMAND.COM is a 16-bit DOS application which is used for older
DOS compatibility and actually runs inside the NTVDM (NT Virtual DOS
Machine) due to its 16-bit nature.

regards,
ssg MS-MVP
pronetworks.org
 
C

Colin Barnhorst

The difference between .com and .exe is how the program was compiled. You
don't get to pick at run time. It is whatever it is.
 
R

R. C. White

Hi, Thread.

I hate to resurrect this two-month-old thread, but I disagree some of the
comments in the parts of the thread that have not scrolled off. Perhaps it
was cleared up in posts that I can't see now; if so, I apologize for butting
in.
CMD.EXE is the Windows NT command line interface, its not a DOS window.

Either CMD.EXE or COMMAND.COM can be used to open a "DOS" window ("DOS" in
quotes to emphasize that it is an emulator, not true MS-DOS). To see for
yourself, click Start | Run (or just press Win+R) and type in the Open box:
cmd, then press Enter. You should see a "DOS" window open. Then click
Start | Run again and enter: Command. You should see a second "DOS" window
open. You can Alt+Tab between them to see the differences, or resize them
to see both "DOS" windows at once and compare them.

CMD.EXE is the 32-bit emulator; COMMAND.COM is the 16-bit version. When in
the CMD.EXE window, type "command" (no quotes) to open the 16-bit emulator
inside the 32-bit; in the COMMAND.COM window, type "cmd" to open the 32-bit
version inside. In either case, Exit returns you to the parent shell; Exit
from the top-level parent closes the window. Most MS-DOS commands work in
either window, although there are some differences. Type Help in either one
to see a list of commands.

And, yes, this works the same for WinXP Home Edition and Professional.

RC
 
D

David Candy

Neither is a Dos window. It is merely a terminal window which dos or windows can write too. Cmd is only one windows program that uses it. Ping is another (if you type it in Start Run it does NOT load cmd or anything else).

Command is a 16 bit command interpreter that runs in a Win32 process that emulates Dos or Windows 3.1. (OS/2 and Posix are native NT sub systems like Win32)
Cmd is a 32 bit Win32 program. It emulates nothing.

Prior to Windows 2000 Dos programs ran in the OS/2 sub system not in the Dos emulator (which ran Win 3.1 programs although it could run Dos programs). This was because OS/2 had better Dos support.
 
W

Wesley Vogel

Using command.com will open cmd.exe.

[[When a command is entered for execution by this shell {command.com}, it
does not actually execute it. Instead, it packages the command text and
sends it to a 32-bit CMD.EXE command shell for execution.]]
 
J

JerryM \(ID\)

Command.com used in Windows 98........
Cmd.exe used in XP, (both home and pro)

Wesley Vogel said:
Using command.com will open cmd.exe.

[[When a command is entered for execution by this shell {command.com}, it
does not actually execute it. Instead, it packages the command text and
sends it to a 32-bit CMD.EXE command shell for execution.]]

--
Hope this helps. Let us know.
Wes

In
R. C. White said:
Hi, Thread.

I hate to resurrect this two-month-old thread, but I disagree some of
the comments in the parts of the thread that have not scrolled off.
Perhaps it was cleared up in posts that I can't see now; if so, I
apologize for butting in.


Either CMD.EXE or COMMAND.COM can be used to open a "DOS" window
("DOS" in quotes to emphasize that it is an emulator, not true
MS-DOS). To see for yourself, click Start | Run (or just press
Win+R) and type in the Open box: cmd, then press Enter. You should
see a "DOS" window open. Then click Start | Run again and enter:
Command. You should see a second "DOS" window open. You can Alt+Tab
between them to see the differences, or resize them to see both "DOS"
windows at once and compare them.

CMD.EXE is the 32-bit emulator; COMMAND.COM is the 16-bit version.
When in the CMD.EXE window, type "command" (no quotes) to open the
16-bit emulator inside the 32-bit; in the COMMAND.COM window, type
"cmd" to open the 32-bit version inside. In either case, Exit
returns you to the parent shell; Exit from the top-level parent
closes the window. Most MS-DOS commands work in either window,
although there are some differences. Type Help in either one to see
a list of commands.

And, yes, this works the same for WinXP Home Edition and Professional.

RC
 
K

Ken Blake

In
JerryM (ID) said:
Command.com used in Windows 98........
Cmd.exe used in XP, (both home and pro)


This is not correct. Both cmd and command work in Windows XP, as
stated below.

--
Ken Blake - Microsoft MVP Windows: Shell/User
Please reply to the newsgroup

Wesley Vogel said:
Using command.com will open cmd.exe.

[[When a command is entered for execution by this shell
{command.com}, it does not actually execute it. Instead, it
packages
the command text and sends it to a 32-bit CMD.EXE command
shell for
execution.]]
--
Hope this helps. Let us know.
Wes

In
R. C. White said:
Hi, Thread.

I hate to resurrect this two-month-old thread, but I disagree
some
of the comments in the parts of the thread that have not
scrolled
off. Perhaps it was cleared up in posts that I can't see now;
if
so, I apologize for butting in.

CMD.EXE is the Windows NT command line interface, its not a
DOS
window.

Either CMD.EXE or COMMAND.COM can be used to open a "DOS"
window
("DOS" in quotes to emphasize that it is an emulator, not
true
MS-DOS). To see for yourself, click Start | Run (or just
press
Win+R) and type in the Open box: cmd, then press Enter. You
should
see a "DOS" window open. Then click Start | Run again and
enter:
Command. You should see a second "DOS" window open. You can
Alt+Tab between them to see the differences, or resize them
to see
both "DOS" windows at once and compare them.

CMD.EXE is the 32-bit emulator; COMMAND.COM is the 16-bit
version.
When in the CMD.EXE window, type "command" (no quotes) to
open the
16-bit emulator inside the 32-bit; in the COMMAND.COM window,
type
"cmd" to open the 32-bit version inside. In either case,
Exit
returns you to the parent shell; Exit from the top-level
parent
closes the window. Most MS-DOS commands work in either
window,
although there are some differences. Type Help in either one
to see
a list of commands.

And, yes, this works the same for WinXP Home Edition and
Professional.
RC

CMD.EXE is the Windows NT command line interface, its not a
DOS
window. Whereas,COMMAND.COM is a 16-bit DOS application
which is
used for older DOS compatibility and actually runs inside
the NTVDM
(NT Virtual DOS Machine) due to its 16-bit nature.

regards,
ssg MS-MVP
pronetworks.org


*ProteanThread* wrote:

and does "command.com" pose a risk (as some viruses that
attacked
older win3x/msdos and win9x machines attached themselves to
command.com) ?
 
R

R. C. White

Hi, Wes.
Using command.com will open cmd.exe.

I'm not sure what this means, but as I said in my earlier post:

CMD.EXE identifies itself in its "DOS" window as:
Microsoft Windows XP [Version 5.1.2600]

COMMAND.COM identifies itself as:
Microsoft(R) Windows DOS

Their claimed copyright dates are 1985-2001 for CMD.EXE, 1990-2001 for
COMMAND.COM.

I'm an accountant (and retired), not a techie, so I'm not sure what goes on
down in the guts of the OS or the NTVDM. My comments were not meant for
experts, but for readers in these newsgroups (windowsxp.basics, .general and
..newusers) who might have been confused by the comment, "CMD.EXE...it's not
a DOS window", in response to the questions in the Subject line. It's easy
to test what I've posted. EITHER of them will open a "DOS" window; neither
of them is true MS-DOS; either can be opened inside the other; and they both
work the same in WinXP Home and WinXP Pro.

RC
--
R. C. White, CPA
San Marcos, TX
(e-mail address removed)
Microsoft Windows MVP

Wesley Vogel said:
Using command.com will open cmd.exe.

[[When a command is entered for execution by this shell {command.com}, it
does not actually execute it. Instead, it packages the command text and
sends it to a 32-bit CMD.EXE command shell for execution.]]

--
Hope this helps. Let us know.
Wes

In
R. C. White said:
Hi, Thread.

I hate to resurrect this two-month-old thread, but I disagree some of
the comments in the parts of the thread that have not scrolled off.
Perhaps it was cleared up in posts that I can't see now; if so, I
apologize for butting in.


Either CMD.EXE or COMMAND.COM can be used to open a "DOS" window
("DOS" in quotes to emphasize that it is an emulator, not true
MS-DOS). To see for yourself, click Start | Run (or just press
Win+R) and type in the Open box: cmd, then press Enter. You should
see a "DOS" window open. Then click Start | Run again and enter:
Command. You should see a second "DOS" window open. You can Alt+Tab
between them to see the differences, or resize them to see both "DOS"
windows at once and compare them.

CMD.EXE is the 32-bit emulator; COMMAND.COM is the 16-bit version.
When in the CMD.EXE window, type "command" (no quotes) to open the
16-bit emulator inside the 32-bit; in the COMMAND.COM window, type
"cmd" to open the 32-bit version inside. In either case, Exit
returns you to the parent shell; Exit from the top-level parent
closes the window. Most MS-DOS commands work in either window,
although there are some differences. Type Help in either one to see
a list of commands.

And, yes, this works the same for WinXP Home Edition and Professional.

RC
 
W

Wesley Vogel

C:\WINDOWS\system32\command.com

Start | Run | Type: command |OK |
See what pops up | To close type: exit |
Hit Enter

Start | Run | Type: cmd |OK |
See what pops up | Close however you like

--
Hope this helps. Let us know.
Wes

In
JerryM (ID) said:
Command.com used in Windows 98........
Cmd.exe used in XP, (both home and pro)

Wesley Vogel said:
Using command.com will open cmd.exe.

[[When a command is entered for execution by this shell
{command.com}, it does not actually execute it. Instead, it packages
the command text and sends it to a 32-bit CMD.EXE command shell for
execution.]]

--
Hope this helps. Let us know.
Wes

In
R. C. White said:
Hi, Thread.

I hate to resurrect this two-month-old thread, but I disagree some
of the comments in the parts of the thread that have not scrolled
off. Perhaps it was cleared up in posts that I can't see now; if
so, I apologize for butting in.

CMD.EXE is the Windows NT command line interface, its not a DOS
window.

Either CMD.EXE or COMMAND.COM can be used to open a "DOS" window
("DOS" in quotes to emphasize that it is an emulator, not true
MS-DOS). To see for yourself, click Start | Run (or just press
Win+R) and type in the Open box: cmd, then press Enter. You should
see a "DOS" window open. Then click Start | Run again and enter:
Command. You should see a second "DOS" window open. You can
Alt+Tab between them to see the differences, or resize them to see
both "DOS" windows at once and compare them.

CMD.EXE is the 32-bit emulator; COMMAND.COM is the 16-bit version.
When in the CMD.EXE window, type "command" (no quotes) to open the
16-bit emulator inside the 32-bit; in the COMMAND.COM window, type
"cmd" to open the 32-bit version inside. In either case, Exit
returns you to the parent shell; Exit from the top-level parent
closes the window. Most MS-DOS commands work in either window,
although there are some differences. Type Help in either one to see
a list of commands.

And, yes, this works the same for WinXP Home Edition and
Professional.

RC

CMD.EXE is the Windows NT command line interface, its not a DOS
window. Whereas,COMMAND.COM is a 16-bit DOS application which is
used for older DOS compatibility and actually runs inside the NTVDM
(NT Virtual DOS Machine) due to its 16-bit nature.

regards,
ssg MS-MVP
pronetworks.org


*ProteanThread* wrote:

and does "command.com" pose a risk (as some viruses that attacked
older win3x/msdos and win9x machines attached themselves to
command.com) ?
 
W

Wesley Vogel

Hi R. C.,

I pretty much agree with everything you've stated.

I don't believe that I qualify as an expert. But I had to get my 2¢ worth
in. :)
===

For a good example of how COMMAND.COM runs CMD.EXE.

Have a look here >>>

The Windows NT Command Shell
http://www.microsoft.com/technet/prodtechnol/winntas/deploy/shellscr.mspx

Scroll down to (or Ctrl + F, for COMMAND.COM runs CMD.EXE) >>>

CMD.EXE and COMMAND.COM
[[You can see COMMAND.COM automatically execute a 32-bit CMD.EXE shell by
using the Windows NT Task Manager application. Follow this procedure:]]

[[This simple experiment shows that every command entered for execution,
regardless of the shell used, is ultimately executed by CMD.EXE, the Windows
NT command shell.]]
===

Also...

NTVDM.EXE is the program that creates the virtual MS-DOS 16-bit environment
and is a Win32 (32-bit) program. NTVDM.EXE = NT Virtual DOS Machine.

We have to remember that Windows XP is really Windows NT 5.1.

When you open command.com, Task Manager shows it as MS-DOS Prompt under
the Applications tab.

In Task Manager, under Applications tab, right click MS-DOS Prompt and
select: Go To Process.

Task Manager will then switch to the Processes tab with ntvdm.exe
highlighted.
===

One of the many ways I seem to learn about things is by posting about
something I think I know about. This usually elicits posts with even more
info about that subject. :-D

--
Hope this helps. Let us know.
Wes

In
R. C. White said:
Hi, Wes.
Using command.com will open cmd.exe.

I'm not sure what this means, but as I said in my earlier post:

CMD.EXE identifies itself in its "DOS" window as:
Microsoft Windows XP [Version 5.1.2600]

COMMAND.COM identifies itself as:
Microsoft(R) Windows DOS

Their claimed copyright dates are 1985-2001 for CMD.EXE, 1990-2001 for
COMMAND.COM.

I'm an accountant (and retired), not a techie, so I'm not sure what
goes on down in the guts of the OS or the NTVDM. My comments were
not meant for experts, but for readers in these newsgroups
(windowsxp.basics, .general and .newusers) who might have been
confused by the comment, "CMD.EXE...it's not a DOS window", in
response to the questions in the Subject line. It's easy to test
what I've posted. EITHER of them will open a "DOS" window; neither
of them is true MS-DOS; either can be opened inside the other; and
they both work the same in WinXP Home and WinXP Pro.

RC
--
R. C. White, CPA
San Marcos, TX
(e-mail address removed)
Microsoft Windows MVP

Wesley Vogel said:
Using command.com will open cmd.exe.

[[When a command is entered for execution by this shell
{command.com}, it does not actually execute it. Instead, it packages
the command text and sends it to a 32-bit CMD.EXE command shell for
execution.]]

--
Hope this helps. Let us know.
Wes

In
R. C. White said:
Hi, Thread.

I hate to resurrect this two-month-old thread, but I disagree some
of the comments in the parts of the thread that have not scrolled
off. Perhaps it was cleared up in posts that I can't see now; if
so, I apologize for butting in.

CMD.EXE is the Windows NT command line interface, its not a DOS
window.

Either CMD.EXE or COMMAND.COM can be used to open a "DOS" window
("DOS" in quotes to emphasize that it is an emulator, not true
MS-DOS). To see for yourself, click Start | Run (or just press
Win+R) and type in the Open box: cmd, then press Enter. You should
see a "DOS" window open. Then click Start | Run again and enter:
Command. You should see a second "DOS" window open. You can
Alt+Tab between them to see the differences, or resize them to see
both "DOS" windows at once and compare them.

CMD.EXE is the 32-bit emulator; COMMAND.COM is the 16-bit version.
When in the CMD.EXE window, type "command" (no quotes) to open the
16-bit emulator inside the 32-bit; in the COMMAND.COM window, type
"cmd" to open the 32-bit version inside. In either case, Exit
returns you to the parent shell; Exit from the top-level parent
closes the window. Most MS-DOS commands work in either window,
although there are some differences. Type Help in either one to see
a list of commands.

And, yes, this works the same for WinXP Home Edition and
Professional.

RC

CMD.EXE is the Windows NT command line interface, its not a DOS
window. Whereas,COMMAND.COM is a 16-bit DOS application which is
used for older DOS compatibility and actually runs inside the NTVDM
(NT Virtual DOS Machine) due to its 16-bit nature.

regards,
ssg MS-MVP
pronetworks.org


*ProteanThread* wrote:

and does "command.com" pose a risk (as some viruses that attacked
older win3x/msdos and win9x machines attached themselves to
command.com) ?
 
D

David Nimon

In the old days of DOS, as I remember, *.com files got processed before
*.exe files. Code under a certain size got compiled as .com while larger
size code compiled as .exe files. Further, you could have a fubar.com and a
fubar.exe file in the same directory ('folder' to 'youngsters' here <g>) and
the fubar.com got executed if the user simply typed 'fubar' at the prompt.
 
W

Wesley Vogel

David,

<LOL>

I Have plenty of things that are fubar. But no files by that name. ;-)

From various sources.

BAT is short for Batch. Identifies a text file you create that contains a
set of MS-DOS commands that are run when you type the name of the file.

COM extension, in MS-DOS, is short for Command. Identifies a command file
that contains a program MS-DOS runs when you type the file name.

EXE is short for Executable. Like COM, identifies a command file that
contains a program MS-DOS runs when you type the file name.

Command files contain the instructions that MS-DOS needs to carry out
commands.

How MS-DOS searches for a command

If you type something at the MS-DOS prompt, MS-DOS assumes you have typed a
command name. It then follows a particular sequence in trying to carry out
the command:

1. It checks to see whether you have typed the name of a built-in command,
such as dir or copy. If you did, MS-DOS carries out that command.

2. If what you typed isn't the name of a built-in command, MS-DOS checks to
see if you typed the name of a file with the extension COM or EXE (a
command file). If you did, MS-DOS searches the current directory for
the file and, if it finds the file, loads the program contained in the
file and runs it.

3. If what was typed isn't the name of a command file, MS-DOS checks to see
if you typed the name of a file with the extension BAT (a batch file).
If you did, MS-DOS searches the current directory for the file and, if
it finds the file, carries out the commands in the batch file.

4. If MS-DOS doesn't find the file in the current directory, it performs
steps 2 and 3 of this sequence in each of the directories in the PATH
command.

The sequence is important because it explains why MS-DOS doesn't carry out a
command file with the same name as a built-in command and why it won't carry
out a batch file that has the same name as either a built-in command or a
command file.

MS-DOS searches for a file by using default filename extensions in the
following order of precedence: .COM, .EXE and .BAT.

Amazing what you find in old MS-DOS books that still applies to XP.

Path
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/path.mspx

C:\>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\Support Tools\;C:\Program Files\Common Files\Autodesk Shared\

C:\>echo %pathext%
..COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top