In linux, we have "which" command to find out path of executable. what is its windows equivalent? Is there any powershell command for doing that?

Thank you,

link|improve this question
feedback

migrated from stackoverflow.com Nov 6 '10 at 0:38

This question came from our site for professional and enthusiast programmers.

3 Answers

Yes, Get-Command will find all commands including executables:

PS\> Get-Command ipconfig

If you want to limit the commands to just executables:

PS\> Get-Command -CommandType Application

Will find all exes in your path. There is an alias for interactive use:

PS\> gcm net* -CommandType Application

For more info, run man Get-Command -full.

link|improve this answer
feedback

Some versions of Windows (I think Windows 2003 and up) have the where command:

c:\>where ping
C:\Windows\System32\PING.EXE
link|improve this answer
where work for me in Windows 7 – Nam G. VU Oct 10 '11 at 16:30
feedback

In addition to user10404, the help command will work on aliases, so you can use the same command name (gcm) for help and interactive use:

help gcm -Parameter *
# or
man gcm -Par *
link|improve this answer
feedback

Your Answer

 
or
required, but never shown