Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

PATH

Direct answer

PATH is an environment variable containing an ordered, semicolon-separated list of directories used during executable/command resolution. The exact resolution algorithm depends on the caller: cmd, PowerShell and application-launch APIs can apply additional rules before or around PATH.

When to use this

Use it when a command is not found, the wrong executable runs, different shells resolve the same name differently, or a newly added tool directory is not visible to an existing process.

First 30 seconds

1. Get-Command <name> -All / where.exe <name> — found? which first?

2. Not found → install directory in PATH?

3. Wrong version → reorder PATH or use the full path.

4. Changed PATH → open a new shell (and restart services).

5. Scheduled tasks/services → use full paths.

Operational verification

command name → current directory (CMD) / PATH order and PATHEXT → first match executed

Evidence · next step

Run the intended full path directly, then troubleshoot that executable’s dependencies/permissions if it still fails.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
PATH changed, but this terminal did not

PATH is itself an environment variable, so persistent changes follow the same process-inheritance boundary as other environment variables. An already-open terminal, IDE or service can keep its old PATH. Verify the current process value before editing PATH repeatedly.

Operational checks for PATH — PATH changed, but this terminal did not: Anchor the same process/service/object, security context and effective runtime state; registry or GUI configuration alone is not closure.

Platform / version applicability
Microsoft Windows
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMicrosoft Windows
Scope / prerequisiteUse it when a command is not found, the wrong executable runs, different shells resolve the same name differently, or a…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Fast command-resolution test Verify boundary

1. Open the exact shell/context that fails.

2. Record the effective PATH.

3. Resolve the name to a command type/full path.

4. Search for duplicate binaries with the same name.

5. Run the intended executable by full path.

If the full path works, the problem is discovery/resolution. If it still fails, leave PATH and troubleshoot the executable/dependencies.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • PATH is ordered; an earlier matching executable can shadow a later one.
  • PowerShell can resolve aliases, functions and cmdlets before external applications, so PATH is not its only command-resolution layer.
  • PATHEXT affects extensionless executable lookup in Windows command environments.
  • PATH is inherited through process environment state; newly configured entries may require a new shell/process.
  • Writable or untrusted directories early in PATH can create command-hijacking risk.
Key checks
  • $env:Path -split ';' — search directories in order
  • Get-Command <name> -All — every match PowerShell finds
  • where.exe <name> — matches in CMD search order
  • [Environment]::GetEnvironmentVariable('Path','Machine') — machine PATH
ReferenceWhat it is1 section · depth on demand

PATH is ordered search input

On Windows, PATH stores directories separated by semicolons. Command environments use these directories when resolving an external executable name. Because the list is ordered, the first applicable match can win. Duplicate tool installations therefore create a common failure mode: PATH contains the “right” directory, but another copy of the same executable is found earlier.

ReferenceImportant terms & boundaries2 sections · depth on demand

PowerShell and cmd do not resolve names identically

In cmd, executable search is closely tied to command paths and extension rules. PowerShell has additional command types — aliases, functions and cmdlets — that can resolve before an external application. When comparing shells, do not ask only “is the directory in PATH?” Ask what command type and full path did this shell actually resolve?

In depth

PATH is the environment variable listing directories Windows searches for executables when a command is typed without a full path. Order matters: the first match wins.

$env:Path -split ';'
Get-Command python | Select-Object Source        # which executable actually runs
where.exe python
[Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\Tools', 'Machine')

Common problems:

ProblemCause
"is not recognized as an internal or external command"Directory not in PATH, or new PATH not loaded in the session
Wrong version runsAnother directory earlier in PATH
PATH truncatedEdited with tools that limit length

Security: user-writable directories early in the system PATH allow DLL and executable hijacking — keep system PATH entries in protected locations.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docMicrosoft Windows current

Authoritative/upstream documentation reviewed for bounded claims in Windows Fundamentals → PATH. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows/ · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
windows path variablecommand not found windowswindows command search pathPATHEXTwhere executable windows
Embedded reference data

Quick lookup tables

PATH troubleshooting boundaries

Why a correct-looking PATH can still resolve the wrong command.

BoundaryCheckCommon failure
Process environmentcurrent PATH valueshell inherited stale PATH
Shell resolutionaliases/functions/cmdlets vs external commandPowerShell resolves another command type first
Directory orderfirst matching executableolder copy shadows desired tool
Extension rulesPATHEXT / explicit extensionextensionless command not resolved as expected
Filesystem/accessexecutable exists and can be accessedPATH is correct but file missing/blocked
Confirmation

Confirm action

Continue?