Microsoft KB Archive/76298

= PATH Command Has No Effect in NMAKE =

PSS ID Number: 76298

Article Last Modified on 10/23/1999

-

The information in this article applies to:


 * Microsoft NMAKE Utility for MS-DOS 1.01
 * Microsoft NMAKE Utility for MS-DOS 1.11
 * Microsoft NMAKE Utility for MS-DOS 1.12
 * Microsoft NMAKE Utility for MS-DOS 1.13
 * Microsoft NMAKE Utility for MS-DOS 1.2
 * Microsoft NMAKE Utility for MS-DOS 1.3
 * Microsoft NMAKE Utility for MS-DOS 1.4
 * Microsoft NMAKE Utility for OS/2 1.11
 * Microsoft NMAKE Utility for OS/2 1.12
 * Microsoft NMAKE Utility for OS/2 1.13
 * Microsoft NMAKE Utility for OS/2 1.21
 * Microsoft NMAKE Utility for Windows NT 1.4
 * Microsoft NMAKE Utility for Windows NT 1.5

-



This article was previously published under Q76298



SUMMARY
In NMAKE, a command line that changes the operating system PATH command does not affect the other commands that NMAKE processes. This is part of the design behavior of NMAKE. To change the PATH environment variable, use the SET command.



MORE INFORMATION
The NMAKE documentation provided with Microsoft C version 6.0 and Microsoft Macro Assembler (MASM) version 6.0 state that NMAKE supports any command that you can run at the MS-DOS command prompt. This statement is not entirely true. NMAKE does not emulate the PATH command and ignores it.

There are two methods to modify the PATH environment variable in NMAKE. You can create a PATH macro to contain the path to assign to the PATH system variable. The macro name &quot;PATH&quot; must be in uppercase letters. Alternately, you can use the SET command. For example, you could place the following line into a description block: SET PATH=c:\;c:\dos.

The following sample makefiles demonstrate these concepts. In the first makefile, the PATH command has no effect. The second and third makefiles demonstrate two methods to modify the PATH, effectively emulating the PATH command entered at the MS-DOS or OS/2 prompt.

Sample Makefile #1
all: path c:\c700\bin; cl /c sample.c
 * 1) The PATH command has no effect on the contents of the PATH
 * 2) environment variable.

Sample Makefile #2

 * 1) The SET command in this makefile temporarily modifies the PATH
 * 2) system variable for commands that are processed for the duration
 * 3) of the makefile.

all: set path=c:\c700\bin; cl /c sample.c

Sample Makefile #3

 * 1) The macro called PATH modifies the PATH system variable for the
 * 2) duration of the makefile.

PATH=c:\c700\bin; all: cl /c sample.c

Additional query words: kbinf 1.10 1.20 1.21 1.30 1.40 1.50

Keywords: KB76298

Technology: kbAudDeveloper kbNMAKE101DOS kbNMAKE111DOS kbNMAKE111OS2 kbNMAKE112DOS kbNMAKE112OS2 kbNMAKE113DOS kbNMAKE113OS2 kbNMAKE120DOS kbNMAKE121OS2 kbNMAKE130DOS kbNMAKE140DOS kbNMAKE140NT kbNMAKE150NT kbNMAKESearch kbVCsearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.