Files & Directories
Cheat sheet · https://pcornel.dk/topic.php?topic=2972
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.
Remember
- MAX_PATH 260 still breaks many apps.
- UNC uses Kerberos by name, NTLM by IP.
- Locked files block moves and deletes.
First checks
Get-ChildItem <path> -Force— contents including hiddenTest-Path <path>— exists?Resolve-Path <path>— full pathGet-Item <path> | fl *— attributes and timestamps
Commands
robocopy- Copy files robustly with retries and mirroring.
xcopy- Copy files and directory trees (legacy; prefer robocopy).
copy- Copy files in Command Prompt.
move- Move files in Command Prompt.
del- Delete files in Command Prompt.
mkdir- Create a directory.
rmdir- Remove a directory.
Verify in this order
path → volume → directory → file → ACL check
Where it usually breaks
First mismatch in target identity/version → persistent configuration/source of truth → provider/service/control plane → runtime/effective state → user/workload-visible result → event/log evidence; preserve identity/native error/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2972