PRB: "Bad command or file name" Error When RC.EXE Not Found

Last reviewed: July 22, 1997
Article ID: Q129415
1.50 1.51 1.52 WINDOWS kbtool kbprb

The information in this article applies to:

  • The development environment included with: Microsoft Visual C++ for Windows, versions 1.5, 1.51 and 1.52

SYMPTOMS

The Visual Workbench is unable to run the resource compiler, RC.EXE. The output windows shows results similiar this:

   Compiling resources...
   Bad command or file name
   Compiling...
   <drive>:\<path>\<filename>.cpp
   Linking...
   Binding resources...
   Bad command or file name
   Creating browser database...
   <filename>.EXE - 0 error(s), 0 warning(s)

In the two steps 'Compiling resources...' and 'Binding resources...', the "Bad command or file name" error indicates that RC.EXE was not found.

This occurs only when you run Visual C++ version 1.5x under Windows NT.

CAUSE

There is a problem with the AUTOEXEC.NT file that results in the removal of <msvc>\BIN from the PATH environment variable, where <msvc> is the directory in which Visual C++ is installed.

RESOLUTION

Remove or correct the PATH statement in the AUTOEXEC.NT file. If the existing PATH contains <msvc>\BIN, you can remove the PATH statement from the AUTOEXEC.NT. If you want to add the existing PATH to the AUTOEXEC.NT, add %PATH% as the last item on the PATH environment variable in the AUTOEXEC.NT. Otherwise, add <msvc>\BIN to the PATH in the AUTOEXEC.NT file.

NOTE: AUTOEXEC.NT is located in the <winnt>\SYSTEM32 directory, where <winnt> is the directory in which Windows NT is installed.

STATUS

This behavior is by design. The error message notifies you that RC.EXE was not found.

MORE INFORMATION

Most of the command line tools (compiler, linker, and so on) that ship with Visual C++ versions 1.5x are native Win32-based applications that use the DOSXNT DOS-extender to permit them to run under MS-DOS. In the Windows NT environment, they run as native 32-bit applications without the DOS-extender. RC.EXE is an exception, in that it is a 16-bit tool.

When RC.EXE is spawned by the development environment during a build, Windows NT determines that RC.EXE is an MS-DOS application and prepares to run an MS-DOS application. One of the steps in this preparation is to run the AUTOEXEC.NT batch file.

If <msvc>\BIN is on the existing PATH, a PATH statement is in AUTOEXEC.NT, and neither <msvc>\BIN nor %PATH% are part of that statement, then RC.EXE will not be found.


Additional reference words: 1.50 3.50 3.51
KBCategory: kbtool kbprb
KBSubcategory: VWBIss
Keywords : kb16bitonly


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.

Last reviewed: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.