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?
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:
- At a command prompt from the root of C: run: Dir /s java.exe
- install the win32 port of which.exe (there may be a whence.exe port too)
- use the search functionality in windows explorer
- get one of several third party windows file indexing and searching utilities
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: