I'm trying to determine the location of an executable (java.exe) on Windows. I know it must exist somewhere in the PATH since I can run it, but I don't know the exact directory that it is being run from. On a UNIX system I could use the whence command to obtain this information. Is there an equivalent command for Windows systems?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
On my Vista laptop if I type "where java.exe" from the command prompt it gives me the location of java.exe. Hope this helps. |
|||||||||||
|
|
Not exactly. You have a few choices:
|
|||
|
|
Install this:
http://gnuwin32.sourceforge.net/packages/which.htm
Then open a command prompt and type: |
|||
|
|
In a command prompt type "path".... that will give you your path you can also use the "find" command. |
|||
|
|
|
Check out the first Google hit for "equivalent whence windows". You'll have to write a small utility to do it. |
|||
|
|
|
Here's a "whereis" script from Raymond Chen's blog: http://blogs.msdn.com/oldnewthing/archive/2005/01/20/357225.aspx |
|||
|
|