Many of the articles in this site contain links to
.reg (Registration entries) and
.vbs (VBScript) files. In some articles, I post the contents of
.reg file so that users can make one themselves. This article explains how to create and run
.reg files in Windows.
For example, the following is the Windows Audio service registry keys for Windows 10. Let’s say you want to apply the following settings to the registry.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Audiosrv] "DependOnService"=hex(7):41,00,75,00,64,00,69,00,6f,00,45,00,6e,00,64,00,70,00,\ 6f,00,69,00,6e,00,74,00,42,00,75,00,69,00,6c,00,64,00,65,00,72,00,00,00,52,\ 00,70,00,63,00,53,00,73,00,00,00,00,00 "Description"="@%SystemRoot%\\System32\\audiosrv.dll,-201" "DisplayName"="@%SystemRoot%\\system32\\audiosrv.dll,-200" "ErrorControl"=dword:00000001 "FailureActions"=hex:80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,\ 00,01,00,00,00,60,ea,00,00,01,00,00,00,c0,d4,01,00,01,00,00,00,20,bf,02,00 "Group"="AudioGroup" "ImagePath"=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,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\ 00,76,00,63,00,68,00,6f,00,73,00,74,00,2e,00,65,00,78,00,65,00,20,00,2d,00,\ 6b,00,20,00,4c,00,6f,00,63,00,61,00,6c,00,53,00,65,00,72,00,76,00,69,00,63,\ 00,65,00,4e,00,65,00,74,00,77,00,6f,00,72,00,6b,00,52,00,65,00,73,00,74,00,\ 72,00,69,00,63,00,74,00,65,00,64,00,20,00,2d,00,70,00,00,00 "ObjectName"="NT AUTHORITY\\LocalService" "RequiredPrivileges"=hex(7):53,00,65,00,43,00,68,00,61,00,6e,00,67,00,65,00,4e,\ 00,6f,00,74,00,69,00,66,00,79,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,\ 67,00,65,00,00,00,53,00,65,00,49,00,6d,00,70,00,65,00,72,00,73,00,6f,00,6e,\ 00,61,00,74,00,65,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,\ 00,00,53,00,65,00,49,00,6e,00,63,00,72,00,65,00,61,00,73,00,65,00,57,00,6f,\ 00,72,00,6b,00,69,00,6e,00,67,00,53,00,65,00,74,00,50,00,72,00,69,00,76,00,\ 69,00,6c,00,65,00,67,00,65,00,00,00,00,00 "ServiceSidType"=dword:00000001 "Start"=dword:00000002 "Type"=dword:00000010 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Audiosrv\Parameters] "ServiceDll"=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,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\ 41,00,75,00,64,00,69,00,6f,00,73,00,72,00,76,00,2e,00,64,00,6c,00,6c,00,00,\ 00 "ServiceDllUnloadOnStop"=dword:00000001
To apply the above settings to the registry, copy the above lines to Notepad.
Important: When copying the
.reg file contents to Notepad, if you inadvertently leave a blank line at the top, you’ll get the Cannot import file: The specified file is not a registry script error when importing the .reg file. The first line must always be
Windows Registry Editor Version 5.00 .
Save the file with a .reg extension, say “audiosrv.reg”
Note: Always use double-quotes around file names to avoid double-extensions (e.g.,
audiosrv.reg.txt) from being created.
Once saved the file, right-click on the file and choose Merge.
You’ll see the following prompt:
Adding information can unintentionally change or delete values and cause components to stop working correctly. If you do not trust the source of this information in C:\Users\ramesh\Documents\audiosrv.reg, do not add it to the registry.
Are you sure you want to continue?
Click Yes to continue.
This applies the settings to the registry.
Here is how the Audiosrv registry key looks like in the Registry Editor (
- REG_BINARY, REG_EXPAND_SZ, and REG_MULTI_SZ values show up in hexadecimal values when exported to .reg file.
- REG_DWORD and REG_SZ show up as plain-text.
Microsoft has an excellent guide on this topic. See their KB article How to add, modify, or delete registry subkeys and values by using a .reg file if you want to know in detail about the syntax of .reg files, the data types, etc. To create your own REG file, you can use the instructions and syntax explained in that article.
Using the Registry Editor (
regedit.exe), use the Export.. option in the File menu to save the currently selected branch to a .reg file.
The exported .reg file can be used as a backup before modifying entries or deleting a value or key. Also, the .reg file can be transferred to other systems and the settings can be applied by running the file.
One small request: If you liked this post, please share this?One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.