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 get started, remember that messing with the Registry involves risks. One misstep can lead to serious issues, so it's a good idea to work carefully, perform prior exports, and test locally. This guide will tell you how to do it. exact syntax of .reg, how to add, change, or delete keys and values, how to distribute changes to multiple computers, and a practical example for Internet Explorer with 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 with keys, subkeys and values.

Windows saves system and user settings, as well as those of installed programs. Part of the state resides in system files (such as the well-known NTUSER.dat for each profile) and is loaded upon login. Therefore, any changes you make in the editor are reflected in the system's behavior after a while. restart or log out in many cases.

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 compatibility with older versions.

The general form of a .reg contains blocks of keys in brackets, followed by lines with name-value pairs. It is advisable to leave a space between blocks. blank line to separate routes and make them easier to read and debug.

Windows Registry Editor Version 5.00


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


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

Key aspects of syntax that you must master to avoid making a mess: value name is enclosed in quotes, followed by = and the type+data. For REG_SZ, no type is specified: "Name" = "Data" is sufficient. For other types, type and a colon are specified, for example dword:00000001 or hex:ab,cd.

Common data types and their notation in .reg

Windows works with various types of data, and in .reg they are translated like this: use dword for REG_DWORD (32-bit), 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; a Incorrect formatting will cause the change not to be applied or cause unexpected behavior.

Add or modify keys and values ​​with .reg

To create subkeys and values, declare the path in brackets and add the values ​​below. If a part of the path doesn't exist, will be created automatically in the order in which they appear in the file.

Windows Registry Editor Version 5.00


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

If the value already exists, the new data will be added. overwriteYou can include as many value lines as you want under the same path and combine multiple paths into a single .reg file to apply multiple changes at once.

  How to equalize Windows 10 sound? - Audio settings

Delete keys and values ​​with .reg

To delete an entire key, place a hyphen in front of the path in brackets. This is a destructive delete, so be sure to check that you are pointing to the exact subkey you want to delete.

Windows Registry Editor Version 5.00


If you want to delete a value without deleting the key, use the hyphen after the equal sign: "Name" = -. This is how withdraw only the indicated value, leaving the upper structure intact.

Windows Registry Editor Version 5.00


"ValorObsoleto"=-

The Registry doesn't offer a "rename key" operation for .reg; to rename, delete the key and create another one with the new name. This pattern is important when migrate settings between different key names.

Practical example: FEATURE_BLOCK_LMZ_SCRIPT in Internet Explorer

A typical case is wanting to control the FEATURE_BLOCK_LMZ_SCRIPT feature for iexplore.exe. The common mistake is to write the feature name as if it were a value inside FeatureControl, when the correct thing to do is to create a new one. subkey with the feature name and below the value for the executable.

This would be incorrect (it treats 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 computers, if you're managing 32-bit processes, also add the path under Wow6432Node to cover both environments. This ensures that 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 enables the feature, but it is a good idea to check the documentation for each feature. Concrete FeatureControl to confirm the sense of value.

Good practices and fine details of syntax

Try to keep your paths organized, leaving a blank line between blocks for readability. The Windows editor easily swallows files with multiple blocks, but clear organization helps. diagnose problems if something doesn't fit.

In many .reg files, a trailing blank line helps the editor correctly interpret the last block. Although it's not always essential, adding this "trailing break" avoid surprises in some tools and versions.

Edit the Registry with Regedit and other tools

For specific changes, open the editor with regedit from Start or with Windows+R. In the left pane, navigate through the keys, and in the right pane, edit values. When you're done, it's a good idea to restart or log out to apply.

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 console to operate without opening 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 is 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
  Configure Privacy and Browsing Shield in Advanced SystemCare

Example of adding a value with type and data:

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

If you do it remotely, enable the Remote Registry service and adjust the Firewall. Without those requirements, a remote query or registration will give you access denied or connection error.

Export, import, and distribute changes

To export backups, use File > Export in Regedit and save the .reg file from the branch you're changing. Another option is the console: REGEDIT /EC:\Backup\rama.reg to dump a branch or the entire Registry if you select “All”.

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

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

Distribution can be done by mail, network share or script login. You can also push them with Group Policy if you manage a domain and want configuration uniformity.

Backup and restore in case of problems

Always export the branch before touching it. It's the quickest safety net if something goes wrong. For major issues that prevent a successful startup, you can try starting with the "Last Known Good Configuration" or using Restore points of the system to go back.

If you need to act from the console, boot into safe mode symbol of the system and throw REGEDIT C:\Backup\todo.reg to reimport. The more specific the copy (a specific key/value), the less risk of stepping on foreign configurations when restoring.

Protected entrances and permits

There are system-protected keys. To modify them, open the key permissions window, go to Advanced Options, and adjust ownership and permissions of your user. Only do this if you understand the impact, as granting yourself Full Control on a critical key can open the door to difficult-to-debug errors.

Registry Virtualization

Windows redirects certain writes from apps poorly designed to protect sensitive areas (such as HKLM). So-called Registry virtualization acts transparently to the process and helps Avoid damages 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 before applying it, the tool power toys for the Registry allows you to view the proposed changes compared to the current status. It's very useful for validating and, if you prefer, apply from the tool itself or replicate by hand 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 so you can practice, always with a prior copy.

  • 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.
  Essential tips and tricks to master Counter-Strike 2

Please note that some settings have changed in Windows 11 (for example, the clock can already display seconds from the interface), so sometimes the Registry path is no longer needed or the key cease to exist.

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 copy, and encountering permission problems. Everything has a solution if you go with method.

Quick fixes: Restore the export you made before the change; if the system is unstable, use a restore point; if it won't boot, use Safe Mode and import the correct .reg; and if it's a permissions issue, adjust the ownership and temporarily grant it. Full Control to apply the change, then return the permissions to their safe state.

Tips for designing .reg files that touch multiple keys

Group routes in hierarchical order, separate them with blank lines, use descriptive value names, and keep erasure blocks (hyphenated) separate from creation blocks. Add 32/64-bit versions where applicable and validate in a test equipment before mass deployment.

An important final touch: 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 dialogue or blockages.

With these guidelines, you can create robust, reproducible, and maintainable .reg files, cover mixed 32/64-bit scenarios, automate with reg and distribute via network or startup scripts, while maintaining control with backups and rollback plans if something doesn't go as expected. A little order, a timely backup, and pre-testing often make the difference. everything works the first time.

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