Windows: `Which` Equivalent – CMD & PowerShell

The which command in Linux is used to identify the location of executables.

The where command is a Windows which equivalent in a command-line prompt (CMD).

In a Windows PowerShell the alternative for the which command is the Get-Command utility.

In this note i will show how to find paths of executable commands in Windows.

Cool Tip: Windows lsusb command equivalent in PowerShell! Read more →

Find Executables – Windows ‘which’ Equivalent

Find the location of an executable command using Windows command-line prompt (CMD):

C:\> where <commandName>
- example -
C:\> where systeminfo
- sample output -
C:\Windows\System32\systeminfo.exe

Find the path of an executable command using Windows PoweShell:

PS C:\> Get-Command <commandName>
- or -
PS C:\> where.exe <commandName>

ℹ️ Note that the where command doesn’t display any output when running in PowerShell. Use where.exe instead.

Was it useful? Share this post with the world!

5 Replies to “Windows: `Which` Equivalent – CMD & PowerShell”

  1. Thanks! It helped 😉

  2. Didnt know “WHERE”

    thanks

  3. In PowerShell, get-command can be abbreviated as
    gcm
    like i.e.
    gcm explorer

  4. Helpful, thanks. I kept trying to use `where` in PowerShell. 🤦‍♂️

  5. Thanks a lot

Leave a Reply