BUG: You receive a "The name specified is not recognized" error message when you try to run a batch file tool from the Visual C++ Tools menu on a computer that is running Windows NT or Windows 2000 (191495)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0, when used with:
- the operating system: Microsoft Windows NT
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0, when used with:
- the operating system: Microsoft Windows NT
- Microsoft Visual C++, 32-bit Professional Edition 5.0, when used with:
- the operating system: Microsoft Windows NT
- Microsoft Visual C++, 32-bit Professional Edition 6.0, when used with:
- the operating system: Microsoft Windows NT
- Microsoft Visual C++, 32-bit Learning Edition 6.0, when used with:
- the operating system: Microsoft Windows NT
- Microsoft Windows NT Workstation 3.5
- Microsoft Windows NT Workstation 3.51
- Microsoft Windows NT Workstation 4.0
- Microsoft Windows 2000 Professional
- Microsoft Windows 2000 Server
- Microsoft Windows 2000 Advanced Server
This article was previously published under Q191495 SYMPTOMS On Windows NT and Windows 2000, running a batch file tool
from the Visual C++ Tools menu produces the following error message:
The name specified is not recognized as an internal or
external command, operable program or batch file On the Tools menu,
click Customize. Select the Tools tab on the Customize dialog box. Note that
the arguments contain one or more parameters surrounded with quote (")
characters. This problem did not occur prior to installing a service
pack for Visual Studio 97. CAUSE Visual Studio 97 Service Pack 1 modified the method used to
launch tools. Because Microsoft Windows 95, Microsoft Windows 98, Microsoft
Windows Millennium Edition (Me), Windows NT, and Windows 2000 support long file
names (LFNs) that can contain spaces, the tool launcher now automatically adds
quotes around Tool commands. If the tool command is a batch file, it then
launches the command processor--Cmd.exe on Windows NT--with the quoted command
and any arguments:
CMD.EXE /c "<command>" <arguments>
If a tool parameter might contain an LFN, you must place quotes
around the argument: for example, "$(FileName)$(FileExt)". The resulting
command launched from Visual C++ would look something like this:
CMD.EXE /c "mytool.cmd" "my LFN parameter"
The parameter parsing logic in CMD.EXE strips the first quote and
the last, preserving those in the interior. It then attempts to load the
following: That file name does not exist. RESOLUTION Following are some possible workarounds: - Use Cmd.exe as the command. In the argument field, type /C,
the batch file name, and the arguments:
Command: CMD.EXE
Arguments: /C mytool.bat "my LFN parameter"
If the tool resides in an LFN path with a space, place quotes
around it and also around the entire parameter string after the /C:
Arguments: /C ""my LFN path\mytool.bat" "my LFN parameter""
- Do not put quotes in the tool's Arguments field.
- Use an .exe file as the tool command rather than a batch
file. The executable could launch an appropriate batch file with the arguments
properly formatted.
NOTE: Visual Studio 6.0 solves the typical case
by placing quotes around tools that have a space in their path. However, a
problem can still occur if the tool meets this condition and also has quotes
around any argument.
STATUS Microsoft has confirmed this to be a bug in the Microsoft
products listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/3/2005 |
---|
Keywords: | kbtshoot kbBug kberrmsg kbide kbpending KB191495 kbAudDeveloper |
---|
|