0 of 7 steps0%
Back to guides
Tech & ComputersMedium

How regedit.exe Works — The Windows Registry Explained

A simple, direct walkthrough of what the Windows Registry is, the 5 root hives, value types, how to edit, common tweaks, and safety. No BS, no fluff.

admin
12 min
7 steps
6 views

What is the Registry

Step 1 of 7

  • The Windows Registry is a **hierarchical database** that stores low-level settings for the OS and almost every installed program.
  • Think of it as one giant INI file, but:
  • Faster (binary, not text)
  • Structured (folders + values, not key=value lines)
  • Live (programs read it at startup and while running; changes can take effect immediately)
  • *Where it lives on disk** (don't edit these files directly — that's how you break Windows):
  • | File | Holds |
  • |------|-------|
  • | `C:\Windows\System32\config\SYSTEM` | HKEY_LOCAL_MACHINE\SYSTEM |
  • | `C:\Windows\System32\config\SOFTWARE` | HKEY_LOCAL_MACHINE\SOFTWARE |
  • | `C:\Windows\System32\config\SAM` | HKEY_LOCAL_MACHINE\SAM |
  • | `C:\Windows\System32\config\SECURITY` | HKEY_LOCAL_MACHINE\SECURITY |
  • | `C:\Users\<you>\NTUSER.DAT` | HKEY_CURRENT_USER |
  • | `C:\Windows\System32\config\RegBack\` | Auto-backup copies (created by default on every boot in Win10, off by default in Win11) |
  • The app you use to view and edit it is **regedit.exe** (Start → Run → `regedit`). It has two panes:
  • **Left:** folder tree (keys + subkeys)
  • **Right:** values in the currently-selected key

The 5 Root Hives

Step 2 of 7

  • There are exactly **5 root hives** you see at the top of regedit. They are fixed — you can't add a new one.
  • | Hive | What it stores |
  • |------|----------------|
  • | **HKEY_CLASSES_ROOT (HKCR)** | File associations, COM object registrations, shell commands. Merges HKLM\SOFTWARE\Classes and HKCU\SOFTWARE\Classes. |
  • | **HKEY_CURRENT_USER (HKCU)** | Settings for the *currently logged-in* user — desktop, app preferences, recently used files. |
  • | **HKEY_LOCAL_MACHINE (HKLM)** | Machine-wide settings: hardware drivers, OS config, software installed for all users. |
  • | **HKEY_USERS (HKU)** | All user profiles on this machine. HKCU is just a shortcut to your profile under here. |
  • | **HKEY_CURRENT_CONFIG (HKCC)** | Current hardware profile (display, printers, etc.). Pointer into HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current. |
  • *The mental model:**
  • **HKCU** = "per-user stuff" (theme, language, app settings for *you*)
  • **HKLM** = "machine-wide stuff" (drivers, services, OS config for *everyone*)
  • **HKCR** = "file type → app" mappings
  • **HKU** = "every user that has ever logged in"
  • **HKCC** = "current hardware profile" — almost never edited directly
  • When a program wants a setting, it asks the OS for HKCU\Software\Vendor\App first. If that doesn't exist, it falls back to HKLM\Software\Vendor\App. That's why the same program behaves differently for different users — its settings live in HKCU, not HKLM.

Keys, Subkeys, Values

Step 3 of 7

  • The structure is **folders-in-folders**, like a file system:
  • ```
  • HKEY_CURRENT_USER ← root hive
  • └── Software ← key (folder)
  • └── Microsoft ← subkey
  • └── Windows ← subkey
  • └── CurrentVersion
  • └── Explorer ← subkey
  • ├── value: AltTabSettings = 1 ← REG_DWORD
  • ├── value: Advanced = "<binary>" ← REG_BINARY
  • └── value: Shell = "explorer.exe" ← REG_SZ
  • ```
  • *Vocabulary:**
  • **Key** = a folder. Contains subkeys and/or values.
  • **Subkey** = a key nested inside another key. There's no technical difference — "subkey" just means "a key that's not at the root".
  • **Value** = a single setting inside a key. Has a **name**, a **type**, and **data**.
  • **Default value** = a value with the name `(Default)` (empty parens). Every key has one. If you see `(Default)` with no data, the key has no default value set.
  • *Path notation** uses backslashes between keys, same as Windows paths:
  • ```
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
  • ```
  • *Important:** key names are **case-insensitive** but value names are **case-sensitive**. `MyValue` and `myvalue` are two different values in the same key.

Value Types

Step 4 of 7

  • Every value has a **type**. The type tells Windows how to read the bytes. Get it wrong and the OS will silently misinterpret the data.
  • | Type | What it stores | What it looks like in regedit |
  • |------|----------------|------------------------------|
  • | `REG_SZ` | A string (text). | `"C:\Windows\explorer.exe"` |
  • | `REG_EXPAND_SZ` | A string with environment variables that get expanded. | `"%SystemRoot%\explorer.exe"` |
  • | `REG_MULTI_SZ` | A list of strings, one per line. | `line1\0line2\0line3\0\0` |
  • | `REG_DWORD` | A 32-bit integer. Most "on/off" or numeric settings. | `0x00000001` |
  • | `REG_QWORD` | A 64-bit integer. Less common. | `0x0000000000000001` |
  • | `REG_BINARY` | Raw bytes. | `12 34 56 78 9a bc de f0` |
  • | `REG_NONE` | Data with no defined type. Rare. | `(zero-length binary value)` |
  • *REG_DWORD and the magic of 0/1:**
  • `0` = disabled / off / false
  • `1` = enabled / on / true
  • That's it. For almost every "enable X" tweak you see on the internet, you're setting a DWORD to `1` (or `0` to disable).
  • *REG_SZ vs REG_EXPAND_SZ:**
  • Both look like strings, but `REG_EXPAND_SZ` is processed before the program sees it. If the data contains `%SystemRoot%`, that gets replaced with `C:\Windows` automatically. Don't change a `REG_EXPAND_SZ` to `REG_SZ` unless you know what you're doing.
  • *REG_MULTI_SZ** stores multiple strings with null terminators and a final double-null. In regedit's UI it shows as one string per line. Useful for lists of extensions, search paths, etc.

How to Edit a Value

Step 5 of 7

  • *Open regedit:** Win+R → `regedit` → Enter → Yes to UAC.
  • *Navigate:** click folders in the left pane to expand them. The address bar at the top shows the current path — you can paste a full path there and hit Enter to jump directly.
  • *Read a value:** select a key in the left pane. Its values appear in the right pane with name, type, and data columns.
  • *Edit a value:**
  • 1. Double-click the value (or right-click → Modify)
  • 2. Change the data
  • 3. Click OK
  • 4. Most changes apply **immediately** — no save button. Some need a restart or sign-out to take effect.
  • *Create a new value:**
  • 1. Right-click in the right pane → New → pick the type (DWORD, String, etc.)
  • 2. Type the name
  • 3. Press Enter, then enter the data
  • *Create a new key:** right-click in the left pane → New → Key. Type the name.
  • *Delete a value or key:** select it, press Delete (or right-click → Delete). Confirm.
  • *Find:** Ctrl+F. Searches names, value data, and content. Use this constantly — there's no "recently used" otherwise.
  • *Refresh:** F5. If you change something via script, F5 to see it.
  • *Export a key:** right-click → Export. Saves a `.reg` file (text format, human-readable). This is your **backup** mechanism — covered in step 7.

Common Useful Tweaks

Step 6 of 7

  • These are real, harmless tweaks people do all the time. Each shows the **path**, **value name**, **type**, and **data** you set.
  • *1. Show file extensions in Explorer**
  • Path: `HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced`
  • Value: `Hidden`
  • Type: REG_DWORD
  • Data: `0`
  • *2. Disable recent files in Quick Access**
  • Path: `HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced`
  • Value: `Start_TrackDocs`
  • Type: REG_DWORD
  • Data: `0`
  • *3. Speed up the Start menu (Win10)**
  • Path: `HKCU\Control Panel\Desktop`
  • Value: `MenuShowDelay`
  • Type: REG_SZ
  • Data: `"0"` (was `"400"`)
  • *4. Disable Cortana**
  • Path: `HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search`
  • Value: `AllowCortana`
  • Type: REG_DWORD
  • Data: `0`
  • *5. Add "Open with Notepad" to right-click for any file**
  • Path: `HKCR\*\shell\Open with Notepad\command`
  • Value: `(Default)`
  • Type: REG_SZ
  • Data: `"notepad.exe %1"`
  • *6. Disable Windows telemetry**
  • Path: `HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection`
  • Value: `AllowTelemetry`
  • Type: REG_DWORD
  • Data: `0`
  • *7. Dark title bars for old apps (Win10)**
  • Path: `HKCU\SOFTWARE\Microsoft\Windows\DWM`
  • Value: `UseDWMImmersiveDarkMode`
  • Type: REG_DWORD
  • Data: `1`
  • *8. Disable lock screen ads / suggestions**
  • Path: `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager`
  • Value: `SystemPaneSuggestionsEnabled`
  • Type: REG_DWORD
  • Data: `0`
  • *How to apply a tweak from the internet safely:**
  • 1. Read the path out loud. If it doesn't start with `HKCU` or `HKLM`, be careful.
  • 2. Check the type matches (DWORDs are not strings).
  • 3. Note the **original value** before changing it. Write it down.
  • 4. Make the change.
  • 5. If anything goes wrong, restore the original (see next step).
  • *Rule of thumb:** `HKCU` tweaks are safe to experiment with — they affect only your account, and you can delete the value to undo. `HKLM` tweaks affect everyone and can disable system features.

Backup, Restore, and What NOT to Touch

Step 7 of 7

  • *Backup before you change anything.**
  • 1. Navigate to the key you're about to edit.
  • 2. Right-click it → **Export**.
  • 3. Save as a `.reg` file somewhere obvious (`Desktop\backup-2026-07-20.reg`).
  • 4. Make your change.
  • If you break something, double-click the `.reg` file (or right-click → Merge) to restore. Or in regedit: File → Import → pick the file.
  • *Full registry backup:**
  • File → Export → choose **All** under "Export range" → saves the entire registry as one `.reg` file. Useful before big changes.
  • *Command-line backup/restore (handy in scripts):**
  • ```cmd
  • REM Export a single key
  • reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" explorer-backup.reg
  • REM Import a .reg file (silent)
  • reg import explorer-backup.reg
  • REM Query a value without opening regedit
  • reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName
  • ```
  • `reg query`, `reg add`, `reg delete`, `reg copy`, `reg save`, `reg restore`, `reg load`, `reg unload` — the whole `reg` family. Useful in batch scripts and `runonce` tasks.
  • *What NOT to touch:**
  • | Don't edit | Why |
  • |------------|-----|
  • | `HKLM\SYSTEM\CurrentControlSet\Enum` | Hardware enumeration. Break this and Windows can't find your devices. |
  • | `HKLM\SYSTEM\MountedDevices` | Tracks drive letters. Wrong value = drives disappear. |
  • | `HKLM\SAM\SAM` | Security Account Manager. Requires SYSTEM privileges to even open. |
  • | `HKLM\SECURITY` | Security policies. Same. |
  • | `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon` | Controls login. Wrong value = boot loop. |
  • | Anything in `HKCR\CLSID` you don't recognize | COM object registrations. |
  • *The .reg file format** (so you can read backups and community tweaks):
  • ```
  • Windows Registry Editor Version 5.00
  • [HKEY_CURRENT_USER\Software\MyApp]
  • "Setting1"="Hello"
  • "Setting2"=dword:00000001
  • "Setting3"=hex:12,34,56,78
  • "Setting4"=hex(7):73,00,74,00,72,00,69,00,6e,00,67,00,00,00
  • "Setting5"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,00,00
  • [HKEY_CURRENT_USER\Software\MyApp\Subkey]
  • @="Default value data"
  • ```
  • Format notes:
  • `@` means `(Default)` value
  • `dword:` = REG_DWORD
  • `hex:` = REG_BINARY
  • `hex(7):` = REG_MULTI_SZ (UTF-16LE, null-separated, double-null at end)
  • `hex(2):` = REG_EXPAND_SZ
  • All strings are UTF-16LE for .reg files (each ASCII char is two bytes with a `00` after)
  • You can write `.reg` files in any text editor and double-click them to apply. They're plain text — perfect for sharing tweaks, version-controlling system config, or scripting.