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.

Possible Duplicate:
Windows equivalent of whereis?

It's easy enough to write a simple script that works like the which(1) command from unix, which searches for a given command along the PATH. Unfortunately, the CreateProcess function is not so simple, so this type of script does not give accurate results: CreateProcess looks in a number of directories not in the PATH, looks for files with all of the extensions listed in PATHEXT, etc. Worse, who knows what might be added in future versions of Windows?

Anyway, my question is: is there a robust, accurate which(1) equivalent for Windows, which always tells you what file CreateProcess would find?

share|improve this question

marked as duplicate by akira, quack quixote May 29 '10 at 21:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I don't see how this is an exact duplicate of "Windows equivalent of whereis", since the asker may not know what "whereis" is (as I don't, and I've used unix for decades). And now that I've looked it up, it's not obvious how to map usage of whereis to that of which. –  LarsH Apr 21 '11 at 15:31

1 Answer 1

I use gnuwin32 which :-)

The GnuWin32 port of Which searches for a matching file in the following sequence of directories:

* The current directory.
* The directories that are listed in the PATH environment variable
share|improve this answer

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