Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

Files & Directories

Direct answer

Files and directories in Windows are organized in a tree on each volume, addressed by drive-letter paths or UNC paths, and managed with File Explorer, cmd, PowerShell and robocopy.

When to use this

Use this when working with Windows paths, file operations, long paths or UNC paths.

First 30 seconds

1. Test-Path <path> — exists?

2. Get-Acl <path> — access?

3. Hidden/system? Get-ChildItem -Force.

4. Long or special path?

5. Copy with robocopy for large or metadata-preserving copies.

Operational verification

path → volume → directory → file → ACL check

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Using xcopy instead of robocopy for large copies (no retry, no ACLs by default).
  • robocopy /MIR against the wrong target, deleting files.
  • Forgetting -LiteralPath in PowerShell for names with [ or ].
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 · Windows / Windows Server / PowerShell
Key commandrobocopy
Scope / prerequisiteUse this when working with Windows paths, file operations, long paths or UNC paths.
Reference · 7
What next?2 suggested next steps
Child topics (this level)5
Catalog command links7
Evidence0
On this pageJump to a specific section
Windows command reference

Primary Commands

Configuration and operational commands for this Topic.

Drill down

Subtopics

Go one level deeper into this subject.

Key points
  • MAX_PATH 260 still breaks many apps.
  • UNC uses Kerberos by name, NTLM by IP.
  • Locked files block moves and deletes.
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
ReferenceHow it works1 section · depth on demand

In depth

Everyday file operations from the command line:

TaskPowerShellcmd
ListGet-ChildItem -Forcedir /a
Copy tree with ACLsrobocopy src dst /E /COPYALL /R:1 /W:1same
Mirrorrobocopy src dst /MIR (deletes extras)same
Find big filesGet-ChildItem -Recurse -File \| Sort Length -Desc \| Select -First 20—
Delete treeRemove-Item -Recurse -Forcerd /s /q
HashGet-FileHash -Algorithm SHA256certutil -hashfile f SHA256

robocopy exit codes 0–7 mean success (8+ are failures) — scripts must not treat 1 as an error.

ReferenceImportant terms & boundaries1 section · depth on demand
ReferenceConfiguration & state1 section · depth on demand

Useful commands

TaskcmdPowerShell
Listdir /aGet-ChildItem -Force
Copycopy, robocopyCopy-Item
Move/renamemove, renMove-Item, Rename-Item
Deletedel, rd /sRemove-Item -Recurse
Findwhere /r C:\ file.txtGet-ChildItem -Recurse -Filter
Sizedir /s(Get-ChildItem -Recurse | Measure Length -Sum).Sum

Use robocopy for large or resumable copies with permissions (/MIR /COPYALL /R:1 /W:1).

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. 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?