Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If you invoke nmake ( or any exe) on command line in Windows, Windows will search through all the path variables and append the directory to front of the nmake and execute it.

Besides path, is there any other environmental variable that Windows will search and append to the front of nmake?

share|improve this question

3 Answers 3

no, not that i know.

(and i do not consider PATHEXT as answer ... it just APPENDS some patterns to the thing you throw at CMD to find the right binary)

share|improve this answer

PATH is the only environment variable that contains locations that Windows will prepend to your command to find a program to run. However, Windows does use the PATHEXT variable to determine what file extensions to append to your command to find a file to run.

The algorithm is a bit like this:

  • for each entry in PATH, do until a file is found:
    • file = entry + command; check for file
    • for each entry in PATHEXT, do until a file is found:
      • file = file + entry; check for file
  • if a file was found, run it
share|improve this answer

No.

PATH is an environment variable the shell uses to resolve under-specified executable locations. When you type nmake, the shell first looks in the current directory for something it can run (nmake.exe, nmake.bat, etc.) and executes it if it's found. If not, it then looks at each directory specified in PATH looking for the exectuable and runs the first one it finds.

There's nothing special about PATH except that it's the variable the shell uses for this purpose. There's no reason the shell would try to use any other variable for this purpose.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.