Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

Paths

Direct answer

Windows paths can be absolute (C:\Users\pat\file.txt), relative (.\data), UNC (\\server\share\file) or device paths (\\?\C:\). They are case-insensitive and use backslashes, though forward slashes often work.

When to use this

Use this when writing or interpreting Windows paths correctly.

First 30 seconds

1. Absolute (C:\x) vs relative (.\x) path?

2. Working directory: Get-Location.

3. Quote paths with spaces.

4. PowerShell providers: HKLM:, Cert: paths.

5. Resolve: Resolve-Path.

Operational verification

path string → resolved against drive/current directory → object

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Paths with spaces not quoted in scripts and scheduled tasks.
  • Relative paths in scheduled tasks (working directory is C:\Windows\System32).
  • Hard-coded C:\Users\name instead of %USERPROFILE% / $env:USERPROFILE.
  • Mixing / and \ in tools that only accept one.
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 this when writing or interpreting Windows paths correctly.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
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
  • Windows paths are case-insensitive.
  • Relative paths resolve against the current working directory.
  • Paths with spaces must be quoted.
Key checks
  • Get-ChildItem <path> -Force — contents including hidden
  • Test-Path <path> — exists?
  • Resolve-Path <path> — full path
  • Get-Item <path> | fl * — attributes and timestamps
ReferenceWhy it matters1 section · depth on demand

Path types

TypeExample
Absolute (drive)C:\Users\pat\file.txt
Relative.\data\file.txt, ..\logs
UNC\\server\share\folder\file.txt
Extended-length\\?\C:\very\long\path
Device\\.\PhysicalDrive0

Paths are case-insensitive. Reserved names (CON, NUL, COM1, LPT1) cannot be used as file names, and names cannot end with a space or period. In PowerShell, use Join-Path and Resolve-Path instead of string concatenation; quote paths with spaces.

ReferenceImportant terms & boundaries2 sections · depth on demand

Environment variables

VariableTypical value
%USERPROFILE%C:\Users\name
%APPDATA%C:\Users\name\AppData\Roaming
%LOCALAPPDATA%C:\Users\name\AppData\Local
%PROGRAMDATA%C:\ProgramData
%SystemRoot%C:\Windows
%TEMP%C:\Users\name\AppData\Local\Temp

In depth

Windows path forms:

FormExampleNotes
AbsoluteC:\Data\file.txtDrive + path
Relative..\logs\app.logFrom current directory
UNC\\server\share\dirNetwork
Extended-length\\?\C:\very\long\pathBypasses MAX_PATH, no normalisation
Device\\.\PhysicalDrive0, \\.\COM1Devices
Volume GUID\\?\Volume{GUID}\Volumes without letters

Reserved names cannot be used as file names: CON, PRN, AUX, NUL, COM1–9, LPT1–9; trailing spaces and dots are stripped by normal APIs.

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 Files & Directories → Paths. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows-server/storage/file-server/ntfs-overview · confidence 94%
Confirmation

Confirm action

Continue?