Udostępnij za pośrednictwem


Find Path of a Command Line Tool

Many times you work on different machines, execute a command line tool but often wonder where that tool is actually installed. One way to figure this out is to look at all environment PATH variables and search them manually in same order as Windows does. But you don’t have to because luckily there is a little known built-in command called WHERE that does that for you:

image

This is similar to Unix commands like WHICH and WHEREIS.

Comments

  • Anonymous
    October 29, 2009
    And for those who didn't just step out of a time machine from 1990, here's two alternatives for PowerShell. :)

started doing this

function WhereIs {  Join-Path ($Env:Path.Split(";")) ($args[0]) -resolve -ea 0 } whereis notepad.exe

then realized I could just do...

get-command notepad.exe