in Windows command line: How to know the path of a command?

8

2

I have some program in many places (it is the java command).. I am starting this command from CMD. the problem is, I need to know exactly the path of the java command being run..

(If you know unix, I need a command such as which ).

Thanks.

Muhammad Hewedy

Posted 2010-10-29T12:32:32.810

Reputation: 369

Answers

2

Does Which for Windows help?

Nifle

Posted 2010-10-29T12:32:32.810

Reputation: 31 337

9

There is no need to install WHICH, as Windows has a native command that does the same things, called WHERE.

It is a native command on Vista onwards, but can be added from the Windows Server 2003 Resource Kit on earlier versions of Windows.

paradroid

Posted 2010-10-29T12:32:32.810

Reputation: 20 970

You can make an which alias to where if you want. – paradroid – 2015-11-04T15:50:10.810

1

There is not an exact equivalent of "Unix's which" in Windows, but that does not mean there is no solution ;) Check out the following link:

Which for Windows

Mehper C. Palavuzlar

Posted 2010-10-29T12:32:32.810

Reputation: 51 093

1

Because time ago I could not found an adequate alternative of "which" command for windows, I implemented a simple replacement in python featuring also partial matches of command names:

https://gist.github.com/667891

Hope you find it useful :)

enlavin

Posted 2010-10-29T12:32:32.810

Reputation: 51