The Windows Folder Layout
Where Linux has one tree under /, Windows has one tree per volume, each with a drive letter. C: is the system drive by tradition (A: and B: were floppy drives), and almost everything that matters lives on it. Like the Linux FHS, the layout of C:\ follows rules: the operating system, installed programs, machine-wide data and per-user data each have their own place. Knowing them tells you where to look for a log, a config file or the cause of a full disk.
The top of C:\
C:\
├── Windows\ the operating system (owned by TrustedInstaller)
│ ├── System32\ 64-bit system DLLs and tools: kernel32.dll, cmd.exe, drivers\
│ ├── SysWOW64\ 32-bit versions of the same, for 32-bit apps
│ ├── WinSxS\ component store: every version of system components
│ ├── Temp\ temporary files of services
│ └── Fonts\, Logs\, Panther\ ...
├── Program Files\ 64-bit applications
├── Program Files (x86)\ 32-bit applications
├── ProgramData\ (hidden) machine-wide app data: settings, caches, licences
├── Users\
│ ├── Public\ files shared by all users
│ ├── Default\ (hidden) template copied for each new profile
│ └── ada\ one profile per user = %USERPROFILE%
│ ├── Desktop\, Documents\, Downloads\, Pictures\, Music\, Videos\
│ └── AppData\ (hidden) per-user app data
│ ├── Roaming\ = %APPDATA% follows the user to other PCs
│ ├── Local\ = %LOCALAPPDATA% stays on this PC (caches, big data)
│ └── LocalLow\ for low-integrity (sandboxed) apps
├── pagefile.sys, swapfile.sys, hiberfil.sys (hidden system files)
└── $Recycle.Bin\ (hidden) per-user recycle binsLinux equivalents
| Windows | Linux | Purpose |
|---|---|---|
C:\Windows, System32 |
/usr/bin, /usr/lib, /boot |
The OS itself |
C:\Windows\System32\drivers |
/lib/modules/<version> |
Kernel drivers (Kernel Modules & Drivers) |
C:\Program Files |
/usr (packages), /opt (vendor bundles) |
Installed applications |
C:\ProgramData |
/etc + /var/lib |
Machine-wide settings and data |
C:\Users\ada |
/home/ada |
A user's home |
%APPDATA% (Roaming) |
~/.config |
Per-user settings |
%LOCALAPPDATA% |
~/.local/share, ~/.cache |
Per-user data and caches |
%TEMP% (AppData\Local\Temp) |
/tmp |
Temporary files |
C:\Windows\System32\config (registry hives) |
/etc |
System configuration (The Windows Registry) |
C:\Windows\Logs, Event Log (.evtx) |
/var/log, the journal |
Logs |
pagefile.sys |
swap partition/file | Virtual memory (Swap & the Page File) |
Environment variables, not hard-coded paths
Users can move their profile, Windows can be installed on D:, and folder names are translated on screen (the German Explorer shows "Benutzer" for C:\Users, though the real folder name stays English). So programs and scripts should never hard-code C:\Users\ada\AppData\Roaming; they use environment variables or the Known Folders API. Here is how a typical PC expands them (sample output, yours will differ):
C:\Users\ada>echo %SystemRoot% & echo %ProgramFiles% & echo %ProgramData%
C:\WINDOWS
C:\Program Files
C:\ProgramData
C:\Users\ada>echo %USERPROFILE% & echo %APPDATA% & echo %LOCALAPPDATA% & echo %TEMP%
C:\Users\ada
C:\Users\ada\AppData\Roaming
C:\Users\ada\AppData\Local
C:\Users\ada\AppData\Local\TempThe program below imitates cmd's %VAR% expansion with that same set of variables, and shows where a well-behaved app called Notely would put each kind of file:
import re
env = {
"SystemDrive": "C:", "SystemRoot": r"C:\WINDOWS",
"ProgramFiles": r"C:\Program Files", "ProgramFiles(x86)": r"C:\Program Files (x86)",
"ProgramData": r"C:\ProgramData", "USERPROFILE": r"C:\Users\ada",
"APPDATA": r"C:\Users\ada\AppData\Roaming", "LOCALAPPDATA": r"C:\Users\ada\AppData\Local",
}
env["TEMP"] = env["LOCALAPPDATA"] + r"\Temp"
def expand(text):
# %NAME% is looked up case-insensitively; unknown names are left as they are (like cmd)
lookup = {k.upper(): v for k, v in env.items()}
return re.sub(r"%([^%]+)%", lambda m: lookup.get(m.group(1).upper(), m.group(0)), text)
plan = [
("program files", r"%ProgramFiles%\Notely\notely.exe"),
("machine-wide config", r"%ProgramData%\Notely\license.dat"),
("user settings", r"%AppData%\Notely\settings.json"),
("user cache", r"%LocalAppData%\Notely\Cache\index.db"),
("crash dump", r"%Temp%\notely-crash.dmp"),
("user documents", r"%UserProfile%\Documents\Notes\todo.note"),
("typo", r"%APDATA%\Notely"),
]
for what, path in plan:
print(f"{what:20} {expand(path)}")program files C:\Program Files\Notely\notely.exe
machine-wide config C:\ProgramData\Notely\license.dat
user settings C:\Users\ada\AppData\Roaming\Notely\settings.json
user cache C:\Users\ada\AppData\Local\Notely\Cache\index.db
crash dump C:\Users\ada\AppData\Local\Temp\notely-crash.dmp
user documents C:\Users\ada\Documents\Notes\todo.note
typo %APDATA%\Notely
The last line shows a real cmd behaviour: an undefined variable is left in the text unchanged, so a typo silently produces a strange relative path instead of an error.
Roaming vs Local matters in companies: on a domain with roaming profiles or folder redirection, Roaming is copied to the server at logoff and down to whichever PC you sign into next, so it should hold small settings only. Browser caches and big databases go in Local.
Who may write where
| Location | Normal user | Administrator (elevated) | Notes |
|---|---|---|---|
C:\Windows |
read | read (mostly) | Owned by TrustedInstaller; only Windows Update and installers change it |
C:\Program Files |
read | write | Installers need elevation (UAC prompt) |
C:\ProgramData |
read, create new | write | Apps grant per-folder rights at install |
C:\Users\ada |
full control (own profile) | full control | Other users are denied |
C:\Users\Public |
write | write | Shared with everyone |
This is the Windows version of "only root writes to /usr". It is also why per-user installers (VS Code "User Installer", winget --scope user) put programs in %LOCALAPPDATA%\Programs instead: no admin rights needed. More in Windows Users, UAC & ACLs.
32-bit apps and the System32 surprise
On 64-bit Windows, System32 holds the 64-bit files and SysWOW64 ("Windows-on-Windows 64") holds the 32-bit ones. The names are historical and confusingly backwards. To keep old 32-bit programs working unchanged, the WOW64 file system redirector silently rewrites their paths:
def resolve(path, process_bits):
p = path.lower()
if process_bits == 32:
for exempt in (r"c:\windows\system32\drivers\etc", r"c:\windows\system32\spool"):
if p.startswith(exempt):
return path # a few folders are exempt
if p.startswith(r"c:\windows\sysnative"):
return "C:\\Windows\\System32" + path[len(r"C:\Windows\Sysnative"):]
if p.startswith(r"c:\windows\system32"):
return "C:\\Windows\\SysWOW64" + path[len(r"C:\Windows\System32"):]
return path
for path in [r"C:\Windows\System32\cmd.exe", r"C:\Windows\System32\drivers\etc\hosts",
r"C:\Windows\Sysnative\cmd.exe"]:
for bits in (64, 32):
print(f"{bits}-bit app opens {path:42} -> {resolve(path, bits)}")64-bit app opens C:\Windows\System32\cmd.exe -> C:\Windows\System32\cmd.exe
32-bit app opens C:\Windows\System32\cmd.exe -> C:\Windows\SysWOW64\cmd.exe
64-bit app opens C:\Windows\System32\drivers\etc\hosts -> C:\Windows\System32\drivers\etc\hosts
32-bit app opens C:\Windows\System32\drivers\etc\hosts -> C:\Windows\System32\drivers\etc\hosts
64-bit app opens C:\Windows\Sysnative\cmd.exe -> C:\Windows\Sysnative\cmd.exe
32-bit app opens C:\Windows\Sysnative\cmd.exe -> C:\Windows\System32\cmd.exe
Sysnative is a virtual alias that only 32-bit processes can see; it lets them reach the real 64-bit System32 on purpose. (A 64-bit process has no such folder.) Program Files is handled similarly: 32-bit installers are steered into Program Files (x86), and the registry has a matching WOW6432Node redirection.
Junctions that keep old paths working
Windows XP stored profiles in C:\Documents and Settings. Old programs still try that path, so modern Windows keeps a hidden junction (a folder-level reparse point, see Links, Inodes & File Metadata) that points to C:\Users. You can list such links with dir /al (sample output):
C:\>dir /al /a:h C:\
Volume in drive C is Windows
Volume Serial Number is 2C8D-F3A1
Directory of C:\
07/05/2025 06:12 AM <JUNCTION> Documents and Settings [C:\Users]
0 File(s) 0 bytes
1 Dir(s) 201,384,628,224 bytes free
C:\>dir /al /a:h C:\Users\ada
07/05/2025 06:14 AM <JUNCTION> Application Data [C:\Users\ada\AppData\Roaming]
07/05/2025 06:14 AM <JUNCTION> Local Settings [C:\Users\ada\AppData\Local]
07/05/2025 06:14 AM <JUNCTION> My Documents [C:\Users\ada\Documents]These compatibility junctions deny "list folder" to everyone, so dir "C:\Documents and Settings" gives Access is denied while opening a file through it works.
Finding what fills C:
The usual suspects when the system drive is full:
| Folder | Why it grows | Safe cleanup |
|---|---|---|
C:\Windows\WinSxS |
Superseded component versions after updates | Dism /Online /Cleanup-Image /StartComponentCleanup |
C:\Windows\SoftwareDistribution\Download |
Downloaded updates | Disk Cleanup / Storage Sense |
%TEMP%, C:\Windows\Temp |
Leftover temporary files | Storage Sense |
hiberfil.sys |
Holds RAM contents for hibernation | powercfg /h off (disables hibernation) |
C:\Windows.old |
The previous Windows after an upgrade | Disk Cleanup, "Previous Windows installation(s)" |
%LOCALAPPDATA% |
Browser, IDE and package caches | Clear in each app |
Never delete inside WinSxS by hand: many files there are hard links shared with System32, so Explorer's size estimate counts them twice and removing them breaks Windows.
Learn more: The Linux Directory Tree · NTFS & Windows File Systems · Batch: Environment
Test yourself
Where should an app store per-user settings that should follow the user to other PCs?
- C:\ProgramData
- %LOCALAPPDATA%
- %APPDATA% (AppData\Roaming)
- C:\Program Files
On 64-bit Windows, which folder contains the 32-bit system DLLs?
- System32
- SysWOW64
- Sysnative
- Program Files
What is C:\Documents and Settings on Windows 11?
- A real folder with old profiles
- A hidden junction pointing to
C:\Usersfor old programs - The Public profile
- A network share