Designing .reg files in Notepad for multiple keys

Last update: 10/10/2025
Author Isaac
  • Precise .reg file syntax and supported data types.
  • Safe methods for adding, modifying, and deleting keys/values.
  • Automation and deployment with reg, regedit /sy directives.
  • Backups, restores, and troubleshooting common errors.

Markdown from Windows Notepad Modify the Registry Windows with .reg files is a powerful yet delicate task, and it's best to do it wisely. That's why here's a complete and practical guide to create, understand, and distribute .reg files with Notepad, covering everything from syntax to real-life cases, backups and troubleshooting, with clear instructions on how to do it safely.

Before we begin, remember that modifying the Registry involves risks. One wrong step can cause serious problems, so it's best to proceed with caution, perform preliminary exports, and test locally. In this guide, you'll find the exact syntax for .reg files , how to add, change, or delete keys and values, how to distribute changes across multiple computers, and a practical example for Internet Explorer using FEATURE_BLOCK_LMZ_SCRIPT.

What is the Registry and how is it organized?

How to access Regedit in Windows 11

The Registry is a hierarchical database where Windows and applications store settings. It is structured into main "hives" such as HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_CLASSES_ROOT, HKEY_USERS, and HKEY_CURRENT_CONFIG , each containing keys, subkeys, and values.

Windows stores system and user settings, as well as those of installed programs. Part of this state resides in system files (such as the familiar NTUSER.dat file for each user profile) and is loaded at login. Therefore, any changes you make in the editor will, in many cases, affect system behavior after a restart or logout .

Complete syntax of a .reg file

A .reg file is plain text that you can edit with Notepad. Its header declares the version of the Registry Editor. On modern systems, the correct line is Windows Registry Editor Version 5.00 ; the REGEDIT4 header is retained for backward compatibility.

The general format of a .reg file contains blocks per key in square brackets, followed by lines with name-value pairs. It is recommended to leave a blank line between blocks to separate paths and facilitate reading and debugging.

Windows Registry Editor Version 5.00


"NombreValor1"="Texto o ruta"
"NombreValor2"=dword:00000001


"NombreValor3"=hex:de,ad,be,ef

Key syntax aspects you must master to avoid mistakes: the value name goes in quotation marks , followed by = and the type+data. For REG_SZ, the type is not specified: simply "Name"="Data". For other types, specify the type and a colon, for example dword:00000001 or hex:ab,cd.

Common data types and their notation in .reg

Windows works with various data types, and in .reg files they are translated as follows: use dword for REG_DWORD (32 bits), hex for REG_BINARY, hex(2) for REG_EXPAND_SZ, and hex(7) for REG_MULTI_SZ. In REG_SZ, no type is specified because the editor assumes a string.

  • REG_SZ → «Name» = «text»
  • REG_DWORD → «Name»=dword:00000000
  • REG_BINARY → «Name»=hex:aa,bb,cc
  • REG_EXPAND_SZ → «Name»=hex(2):25,53,59…
  • REG_MULTI_SZ → «Name»=hex(7):76,61…

It is essential to respect the exact format of each type; an incorrect format will prevent the change from being applied or cause unexpected behavior.

Add or modify keys and values ​​with .reg

To create subkeys and values, declare the path in square brackets and add the values ​​below. If part of the path does not exist, it will be created automatically in the order it appears in the file.

Windows Registry Editor Version 5.00


"Cadena"="Hola"
"Entero"=dword:0000002a

If the value already exists, the new data overwrites it . You can include as many lines of values ​​as you want under the same path and combine multiple paths in a single .reg file to apply multiple changes at once.

  FC25 game not loading: causes, solutions, and tips to fix it

Delete keys and values ​​with .reg

To delete an entire key, place a hyphen before the path in brackets. This is a destructive deletion, so double-check that you are targeting the exact subkey you want to remove.

Windows Registry Editor Version 5.00


If you want to delete a value without removing the key, use the hyphen after the equals sign: "Name"=-. This removes only the specified value , leaving the parent structure intact.

Windows Registry Editor Version 5.00


"ValorObsoleto"=-

The Registry does not offer a "rename key" operation in .reg files; to rename a key, it deletes the existing key and creates a new one with the new name. This pattern is important when migrating configurations between different key names.

Practical example: FEATURE_BLOCK_LMZ_SCRIPT in Internet Explorer

A typical example is wanting to control the FEATURE_BLOCK_LMZ_SCRIPT feature for iexplore.exe. The common mistake is writing the feature name as if it were a value within FeatureControl, when the correct approach is to create a subkey with the feature name and then the value for the executable below it.

This would be incorrect (treat the feature as a string): it doesn't do what you're looking for.

REGEDIT4

"FEATURE_BLOCK_LMZ_SCRIPT"="DWORD:0"

And this is the correct way to set iexplore.exe to 0 under the feature:

Windows Registry Editor Version 5.00


"iexplore.exe"=dword:00000000

On 64-bit systems, if you're managing 32-bit processes, also add the path under Wow6432Node to cover both environments. This ensures the setting affects both 32-bit and 64-bit instances.

Windows Registry Editor Version 5.00


"iexplore.exe"=dword:00000000


"iexplore.exe"=dword:00000000

Remember that 0 usually disables and 1 usually activates the feature, but it's advisable to check the documentation for each specific FeatureControl to confirm the meaning of the value.

Good practices and fine details of syntax

Try to keep the paths organized, leaving a blank line between blocks to make them easier to read. The Windows editor handles files with multiple blocks without problems, but a clear organization helps diagnose issues if something doesn't fit.

In many .reg files, a trailing blank line helps the editor correctly interpret the last block. While not always essential, adding this "final break" prevents unexpected issues with some tools and versions.

Edit the Registry with Regedit and other tools

For specific changes, open the registry editor (regedit) from the Start menu or by pressing Windows+R. Navigate through the keys in the left pane and edit the values ​​in the right pane. When finished, it's advisable to restart your computer or log out for the changes to take effect.

You can also use the Group Policy Editor (gpedit.msc) for policies that write to the Registry, INF files, and scripts (VBScript or PowerShell ) to automate changes, or the reg command in the console to operate without opening the UI.

The reg command: automate from console and scripts

The reg command allows you to add, query, copy, delete, export, and import keys and values ​​from CMD or PowerShell. It's perfect for integrating into startup scripts or remote tasks.

  • reg add: adds keys and values
  • reg query: query keys
  • reg delete: deletes keys/values
  • reg copy, reg compare: copy and compare
  • reg export / reg import: export and import .reg
  • reg save / reg restore / reg load / reg unload: manage hives
  How to access the Elden Ring Shadow of the Erdtree DLC

Example of adding a value with type and data:

reg add HKCU\Software\Ejemplo /v Cadena /t REG_SZ /d Hola /f

If you're doing this remotely, enable the Remote Registration service and adjust the firewall settings. Without these requirements, a remote query or registration will result in an access denied or connection error.

Export, import, and distribute changes

To export backups, in Regedit use File > Export and save the .reg file of the branch you want to modify. Alternatively, you can use the command prompt: REGEDIT /EC:\Backup\branch.reg to dump a branch or the entire Registry if you select "All".

To restore, double-click the .reg file or run `reg import C:\Backup\rama.reg` . In silent deployments, regedit supports the `/s` switch to hide confirmation dialogs.

regedit.exe /s C:\Rutas\cambios.reg

Distribution can be done via email, network share, or login script . You can also push them using Group Policy if you manage a domain and want configuration consistency.

Backup and restore in case of problems

Always export the branch before modifying it. It's the fastest safety net if something goes wrong. For major issues that prevent a proper boot, you can try booting with the "Last Known Good Configuration" or using System Restore Points to revert to a previous state.

If you need to access the command line, boot into Safe Mode with Command Prompt and run REGEDIT C:\Backup\todo.reg to re-import. The more specific the backup (a particular key/value), the less risk of overwriting other configurations during the restore process.

Protected entrances and permits

Some keys are protected by the system. To modify them, open the key's permissions window, go to Advanced Options, and adjust the ownership and your user's permissions . Only do this if you understand the impact, as granting yourself full control over a critical key can lead to errors that are difficult to debug.

Registry Virtualization

Windows redirects certain writes from poorly designed apps to protect sensitive areas (such as HKLM). This process, called Registry virtualization, operates transparently to the process and helps prevent damage when a program attempts to write to read-only locations.

PowerToys Registry Preview and safe reading of .reg files

If you want to inspect a .reg file before applying it, PowerToys ' Registry tool lets you see the proposed changes compared to the current state. It's very useful for validating changes and, if you prefer, applying them directly from the tool or manually replicating them in Regedit.

Useful Tricks (Quick Changes with Registry)

Some common changes in Windows 10/11 can be applied via the Registry. I've compiled several safe and reversible methods for you to practice, always making a backup first.

  • Open programs from the background context menu: Create keys under HKEY_CLASSES_ROOT\Directory\Background\shell\YourProgram and its subkey command with the path to the .exe in the Default value.
  • Speed ​​up the opening of submenus: In HKCU\Control Panel\Desktop set the “MenuShowDelay” value to something like 50 (milliseconds).
  • Hide “3D Objects” in “This PC” (Windows 10): Delete the key {0DB7E03F-FC29-4DC6-9020-FF41B59E513A} under …\Explorer\MyComputer\NameSpace (and under Wow6432Node if 64-bit).
  • Show seconds in the toolbar clock (Windows 10): In HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced create DWORD ShowSecondsInSystemClock=1.
  • Hide OneDrive in Explorer: under HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6} change System.IsPinnedToNameSpaceTree to 0 (repeat on Wow6432Node in 64-bit).
  • Remove Bing from Windows 10 search: In HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search create DWORD BingSearchEnabled=0 and make sure CortanaConsent=0.
  • Disable “Shake to Minimize”: In HKCU\…\Explorer\Advanced create DWORD DisallowShaking=1.
  • Deactivate lock screen: in HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization creates DWORD NoLockScreen=1.
  • Remove “Send To” from the context menu: Edit HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\Send To and leave the default value empty.
  • Change owner and organization: In HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion edit RegisteredOwner and RegisteredOrganization.
  The best way to Take away Location Information From Pictures On iPhone

Keep in mind that some settings have changed in Windows 11 (for example, the clock can now display seconds from the interface), so sometimes the Registry method is no longer necessary or the key no longer exists.

Common mistakes and how to get out of trouble

The most common mistakes when editing the Registry are deleting or modifying the wrong key, entering incorrectly formatted data, not making a backup beforehand, and encountering permission problems . All of these can be fixed if you follow a methodical approach.

Quick solutions: restore the export performed before the change; if the system becomes unstable, use a restore point; if it doesn't boot, resort to safe mode and run the import of the correct .reg file; and if it's a permissions issue, adjust the ownership and temporarily grant Full Control to apply the change, then return the permissions to their safe state.

Tips for designing .reg files that touch multiple keys

Group paths hierarchically, separate them with blank lines, use descriptive value names, and keep delete blocks (with hyphens) separate from create blocks. Add 32/64-bit versions where applicable and validate on a test machine before mass deployment.

One final important point: save .reg files with ANSI or UTF-16 LE encoding with BOM when using non-ASCII characters. And always test the import with regedit /s in a controlled environment to confirm that everything is applied without dialogs or crashes.

With these guidelines, you can create robust, reproducible, and easy-to-maintain .reg files, cover mixed 32/64-bit scenarios, automate with reg, and distribute them over a network or as startup scripts, while maintaining control with backups and rollback plans if something goes wrong. A little organization, a timely backup, and a preliminary test often make all the difference in getting everything working perfectly the first time.

How to use .reg files to modify Windows settings-2
Related articles:
How to use .reg files to modify Windows settings
Isaac

Isaac

Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.