Microsoft KB Archive/38839

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

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          : kbsetup 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

Last Reviewed: September 5, 1997
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.