Locate executables with where.exe on Windows

See every match for a command name across your PATH — the fastest answer to 'which python is actually running?'

WindowsTerminaldeveloperpathLow risk
Run `where.exe python` (in PowerShell, always with the .exe suffix) to list every python on PATH in execution-priority order.

01Command

Command
$ where.exe python

02What it does

where.exe walks the current directory then each PATH entry and prints all matches, first line = the one that will actually execute. In PowerShell `where` is an alias for Where-Object, so typing where.exe in full matters — a classic gotcha. It also does light file pattern searches (`where.exe /r C:\Projects *.sln`), but for PATH debugging the plain form is the one to remember; pair it with `$env:Path -split ';'` to see the raw search order.

03Risk

RiskLow risk
RequirementsUse `where.exe` explicitly in PowerShell — bare `where` runs Where-Object instead.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • where | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents where.exe as displaying the location of files matching a search pattern, searching the current directory and PATH.
  • WHERE - Windows CMD
    SS64 · technical · 2026-09-17
    Evidence: SS64 explains where.exe searches PATH for executables and how it differs from PowerShell's Where-Object alias.

Last verified: 2026-09-17 · Category: Developer

06Related solutions