[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.

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.

Leave a Comment