PRB: %TMP% in NEW-VARS.BAT Causes Fatal Errors

Last reviewed: September 3, 1997
Article ID: Q38839
The information in this article applies to:
  • Microsoft C for MS-DOS, versions 5.0, 5.1, 6.0, 6.0a, 6.0ax
  • Microsoft C/C++ for MS-DOS, version 7.0
  • Microsoft Visual C++ for Windows, versions 1.0, 1.5
  • Microsoft Visual C++ 32-bit Edition, versions 1.0, 2.0, 2.1, 4.0, 5.0

SYMPTOMS

When using a compiler included with one of the products listed above, the following error message is generated:

With Microsoft C compiler versions 5.0, 5.1, 6.0, 6.0a, and 6.0ax:

   fatal error C1042: cannot open intermediate file -- no
                      such file or directory.

With Microsoft C/C++ compiler version 7.0:

   fatal error C1043: cannot open compiler intermediate file

With Microsoft C/C++ versions 8.0 and 8.0c:

   fatal error C1083: Cannot open compiler intermediate file:
                         'path\filename': No such file or directory

With Microsoft C/C++ 32-bit compiler--versions 8.0 and higher--run from within the Visual WorkBench:

   Error: Could not get temporary file name.
   Error: Could not generate command line for the 32-bit C/C++ Compiler for
      80x86 tool.

With Microsoft C/C++ 32-bit compiler--versions 8.0 and higher--run from the command line:

   fatal error C1083: Cannot open compiler intermediate file:
      '<path_and_temporary_filename>': No such file or directory

CAUSE

This message occurs because the setting of the TMP environment variable is invalid. TMP may not specify more than one directory, a directory that does not exist, or a directory that is read-only.

If the NEW-VARS.BAT file was appended to the MS-DOS AUTOEXEC.BAT file and there was already a setting in AUTOEXEC.BAT for the TMP variable, this message will occur because NEW-VARS.BAT contains a %TMP% setting.

RESOLUTION

This message occurs because the setting of the TMP environment variable is invalid. TMP may not specify more than one directory, a directory that does not exist, or a directory that is read-only.

If the NEW-VARS.BAT file was appended to the MS-DOS AUTOEXEC.BAT file and there was already a setting in AUTOEXEC.BAT for the TMP variable, this message will occur because NEW-VARS.BAT contains a %TMP% setting.

MORE INFORMATION

%TMP% appends any TMP directories already defined at that location. Generally, it is best not to have any %<environmental variable>% symbols in AUTOEXEC.BAT because it should be the first place the environment is defined.

For more information on the TMP environment variable, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q74747
   TITLE     : INFO: Why Microsoft Development Tools Use TMP Instead of
               TEMP
Keywords          : c6setup c7setup vc10setup vc15setup vc20setup
Version           : 6.0 6.0a 6.0ax 7.0 1.0 1.5 2.0 2.1 4.0 5.0
Platform          : MS-DOS NT WINDOWS
Issue type        : kbprb


================================================================================


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: September 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.