www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/23/11:32:27

From: "Paul G." <pgarceau AT attbi DOT com>
Organization: Paul G.
To: Mingw users list <mingw-users AT lists DOT sourceforge DOT net>,
DJGPP List <djgpp AT delorie DOT com>
Date: Mon, 23 Sep 2002 06:48:03 -0700
MIME-Version: 1.0
Subject: Re: [Mingw-users] command.com vs. cmd.exe
Message-ID: <3D8EB923.1565.3A553D8@localhost>
In-reply-to: <3D8EBEC6.4030404@wanadoo.fr>
X-mailer: Pegasus Mail for Windows (v4.01)
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On 23 Sep 2002 at 9:12, Daniel Taupin wrote:

> In order to make a portable documentation (possibly associated with a 
> portable set of utilities) I want to know:
> 
>   Is there in WinNT4, Win2000 and/or WinXP a line command controller 
> (i.e. MSDOS emulation windows controller) named COMMAND.COM, in addition 
> to the NT usual CMD.EXE ?

	Depends on OS.

	for NT4, yes.  Both exist.

	To determine which one to use, $ComSpec (environment) variable will give you the 
default, NT4 command line processor (cmd.exe).  If you run a MS-DOS app, (16bit, such as 
a WFW3.11 app or a MS-DOS 6.x based app), "command.com" is invoked because for 
those systems, ComSpec changes.  (MS-DOS looks in MSDOS system directory or 
c:\msdos, WFW3.11 looks in WFW(3.x) system directory (c:\Windows?)).

	Both ComSpecs (MSDOS/WFW3.x) expect "command.com" to be there.

	As to W2k, there is only one command line processor (not sure of name, but think it 
is command.exe).  XP also has a single command line processor (again, not sure of its 
name, but think it is command.exe as well).

	In the case of NT4, command.com and cmd.exe are both located in 
%sysdrive%\%windir%\system32.

	For W2k and XP, I think there is only %sysdrive%\%windir%\system (same as 
Win9x/Me).

	All have ComSpec defined.  ComSpec says exactly _where_ the "default" command 
line processor is located.

	For my NT4:  ComSpec=C:\Winnt\system32\cmd.exe

	To manually find out where a particular command processor is, open a command 
prompt (console) and type "set".  It will list the ComSpec specific to the OS you are using as 
well as all the other environment variables that are currently set for whichever Windows OS 
you are using.

> 
>   In that case, where is it typically stored (\WINDOWS or \WINNT) or its 
> subdir SYSTEM32?

	Again, depends on which OS you are using.  ComSpec is your friend.

> 
>   Second point: somebody (usually competent) told me that (on Win2000 
> and/or WinXP) cmd.exe called a command.com when it has to handle a *.bat 
> file. Is that true, and under which conditions?

	Umm...as others have noted, I do not believe there is such a thing as 
"command.com" under Win2k or XP.

	Paul G.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019