The "which" utility, when launched with the parameter that named the executable file, will tell you the first executable file with the name that it will find in your path, if it is found at all. This gives a good idea of which version of the executable file will be running. (Forgive me if this description is incomplete, but it conveys the general idea)
I’m looking for either the “what” utility port, or the Powershell command, or some other utility that I don’t know about, does the same.
I reviewed the following SO question (and try the logic of the for loop in the selected answer). I would rather have one team that implements this functionality and wants to see if it exists. If something like this does not exist, this logic can be pretty easily inserted into the script:
unix "which java" is the equivalent command in windows?
A "winwhich" utility for CodeProject exists. It did not update after 6 years or so, and when it was built on my Win 7 machine with VS 2010, it crashed at startup. I plan to do my due diligence to find out why she crashed, but we don’t have time until tonight.
Has anyone used another utility or command on Windows to emulate this feature?
source share