Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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,

share|improve this question

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

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.

share|improve this answer

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

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

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 *
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.