[Fix] Cannot import file: The specified file is not a registry script

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.

Registry Editor

Cannot import filename.reg: The specified file is not a registry script. You can only import binary registry files from within the registry editor.

specified file is not a registry script

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"

where:



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.

hand point iconThe 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:

  1. Open (edit) the .reg file using Notepad.
  2. Clear the blank line at the top of the REG file, and save the file.
    specified file is not a registry script
  3. Make sure that the 1st line contains the registry editor version.
If the same error appears after removing the blank 1st line in the .reg file, try these things:

  • 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!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

10 thoughts on “[Fix] Cannot import file: The specified file is not a registry script”

  1. Thanks. The information you provided made it possible to import a file into the registry. Having the Registry Editor version and the blank line did the trick.

    Reply
  2. Same here, saving as ANSI fixed it. It’s totally insane that there is no indication the encoding would be the issue, how would I have ever determined that without finding your post??? Thanks MS.

    Reply

Leave a Comment