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.
PATH
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.
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.
command name → current directory (CMD) / PATH order and PATHEXT → first match executed
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
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.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
- 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.
PATHEXTaffects 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.
$env:Path -split ';'— search directories in orderGet-Command <name> -All— every match PowerShell findswhere.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:
| Problem | Cause |
|---|---|
| "is not recognized as an internal or external command" | Directory not in PATH, or new PATH not loaded in the session |
| Wrong version runs | Another directory earlier in PATH |
| PATH truncated | Edited 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.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%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.
Quick lookup tables
PATH troubleshooting boundaries
Why a correct-looking PATH can still resolve the wrong command.
| Boundary | Check | Common failure |
|---|---|---|
| Process environment | current PATH value | shell inherited stale PATH |
| Shell resolution | aliases/functions/cmdlets vs external command | PowerShell resolves another command type first |
| Directory order | first matching executable | older copy shadows desired tool |
| Extension rules | PATHEXT / explicit extension | extensionless command not resolved as expected |
| Filesystem/access | executable exists and can be accessed | PATH is correct but file missing/blocked |