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?


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)


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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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