When you try to import a registry file (.reg) by double-clicking it or by using the Import option from within the Registry Editor, the following error occurs. As a result, the .reg file is not imported.
Cannot import filename.reg: The specified file is not a registry script. You can only import binary registry files from within the registry editor.
This post tells you how to fix the .reg file import error in Windows.
Fix for “The specified file is not a registry script” Error
Registration Entries (.reg) file is used to add, modify, or delete registry entries. The Registry Editor (regedit.exe) uses .reg files to import and export registry subkeys and values. You can use these .reg files to distribute registry changes to several Windows-based computers. When you run a .reg file, the file contents merge into the local registry.
A .reg file has the following syntax:
RegistryEditorVersion Blank line [RegistryPath1] "DataItemName1"="DataType1:DataValue1" "DataItemName2"="DataType2:DataValue2" Blank line [RegistryPath2] "DataItemName3"="DataType3:DataValue3"
RegistryEditorVersion is either
Windows Registry Editor Version 5.00 for Windows 2000 and higher systems, or
REGEDIT4 for Windows 98 and Windows NT 4.0. Note that the
REGEDIT4 header also works on Windows 2000 and higher computers, including Windows 10.
The 1st line should start with the registry editor version. This is the basic rule! And it should be followed by a blank line.
Fix the .reg file syntax and formatting
The error “The specified file is not a registry script” occurs if the 1st line in the .reg file is just a blank line, or the registry editor version header is incorrect or missing. To fix the error:
- Open (edit) the .reg file using Notepad.
- Clear the blank line at the top of the REG file, and save the file.
- Make sure that the 1st line contains the registry editor version.
- You may have created or saved the .reg in an editor something other than Notepad. If so, that may have ended up inadvertently adding extra formatting codes. Make sure you recreate the .reg file using Notepad and choose Unicode or ANSI when saving the .reg file.
- Also, see Microsoft article Add, modify, or delete registry entries by using a .reg file to know how to create a .reg file. After reading through the article, you should be able to check if your .reg file contents are legitimate.
That should fix the error “The specified file is not a registry script. You can only import binary registry files from within the registry editor” when importing .reg files in Windows.
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.