Q47763: CMD.EXE Shell Fails with Incorrect COMSPEC
Article: Q47763
Product(s): See article
Version(s): 1.00 1.02
Operating System(s): OS/2
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 26-SEP-1989
Question:
When I attempt to shell out of the MEP editor environment via the
Shell editor function (SHIFT+F9), why does the following message
appear at the bottom of the screen?
Spawn failed on C:\OS2\CMD.EXE - No such file or directory
Response:
The problem is usually due to an incorrect setting of the COMSPEC
environment variable in the CONFIG.SYS file. A faulty setting of this
variable, which informs the operating system of the command
interpreter's location, prevents the DOS EXEC system call from finding
and executing the command interpreter. Use the following procedure to
eliminate the problem:
1. Verify that the CMD.EXE file is in the directory specified by the
COMSPEC environment variable.
2. Ensure the syntax correctness of the COMSPEC setting. There should
be no spaces on either side of the equal sign, and a carriage
return must appear immediately following the last character of the
path and filename setting.
Correct example: SET COMSPEC=C:\OS2\CMD.EXE<cr>
Incorrect examples: SET COMSPEC = C:\OS2\CMD.EXE<cr>
SET COMSPEC=C:\OS2\CMD.EXE;<cr>
SET COMSPEC=C:\OS2\CMD.EXE<space><cr>
Under MEP 1.02, the COMSPEC environment variable is used to locate the
command interpreter. If the command interpreter is not found according
to the COMSPEC variable, the "Spawn failed...." error message is
displayed. MEP Version 1.02 does not use the PATH environment variable
for additional searching of CMD.EXE.
Under MEP Version 1.00, however, the PATH variable is used when the
CMD.EXE is not found via the COMSPEC setting. Hence, if the spawn
failure error occurs when attempting to shell out of the MEP 1.00
environment, examine the COMSPEC setting and also verify that CMD.EXE
is traversed by the search path of the PATH environment variable in
the CONFIG.SYS.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.