Note: Editing the Windows registry is risky so be careful and, if you’re not a moderate-to-advanced user, ask someone else for help.
Using Export in the Registry Editor
The simplest way to create a .Reg file is by making the change you want in the registry editor and then using the editor’s export feature. However, this method only works if all the changes are in the same folder.
1. Open the Registry Editor. You can get there by hitting Windows + R, typing “regedit” into the run box and clicking OK.
2. Navigate to the registry key or value that you wish to export and select it. Note that keys are the “folders” in the registry while values are the individual settings within those folders. If you want an entire key copied, highlight the key.
3. Select Export from the File menu.
4. Name the file and click Save. You must name it with the .reg extension.
Your file will now work for anyone who double clicks it.
Editing a .Reg File
If you want to modify more than just a single key (and its children) or value with your .Reg file, you’ll need to modify it with a text editor.
1. Open an existing .Reg or create a blank document using a text editor such as Notepad.
2. Make sure the top line reads “Windows Registry Editor Version 5.00″ if it does not already.
3. Add the names of registry keys (aka folders) in brackets on their own lines. If a key does not already exist at this location, the .Reg file will create it. For example, enter “[HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindowsPersonalization]” to create or write-to that key.
4. Enter the values on their own lines beneath the appropriate key name. For example, if we want to set NoLockScreen to DWORD value 1, we write “NoLockScreen”=dword:00000001.
You can enter as many different keys and values as you want. While DWORD values, begin with “dword:” and several zeros, string values are just enclosed in quotation marks.
Note: Different registry values are DWORD, String values or other types such as multi-string value or QWORD (64-bit). The type depends on what Windows or an individual application is looking for. DWORD and String Value are the most common, particularly for registry hacks.
5. Set a value to “-“ if you wish to delete the value rather than setting it.
6. Put a “-” in front of a key name if you wish to delete the entire key and all keys and values underneath it. Don’t do this unless you’re sure you’re not deleting something important.
7. Save your file.
Running the .Reg File
Now, anyone who has the file .Reg file can make these registry tweaks by double clicking the file and selecting Yes if prompted.