Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a .reg file but when I double-click it, it doesn't want to be imported.

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

Here is the content of the .reg file

[HKEY_CLASSES_ROOT\Folder\shell\PngCrush]
@=”PNG Crush”

[HKEY_CLASSES-ROOT\Folder\shell\PngCrush\command]
@=”E:\Programs\PNGCrush\crush.bat %1”

Could someone help me? Thanks in advance

share|improve this question
up vote 3 down vote accepted

I don't know how those quotes ended up in that file, but I would assume those don't work (maybe you copied it off a Wordpress blog).

Besides anything else, I think it should be like this:

[HKEY_CLASSES_ROOT\Folder\shell\PngCrush]
@="PNG Crush"

[HKEY_CLASSES-ROOT\Folder\shell\PngCrush\command]
@="E:\Programs\PNGCrush\crush.bat %1"
share|improve this answer
1  
+1 Could be, perhaps he did some international input that uses different characters. – Tom Wijsman Mar 25 '12 at 21:16
    
I didn't notice that! You're right I copied it off the net, thank you! – Aximili Mar 26 '12 at 11:16

That's not the valid syntax of a registry file, it's missing the header.

Add a line in front with: Windows Registry Editor Version 5.00

Check whether there are invalid characters, if you saved the file in Unicode that could be the problem.

share|improve this answer
    
But aximili shouold be sure that this file is unicode. REGEDIT4 should be used for ansi files. – crea7or Mar 25 '12 at 13:23
1  
@crea7or: The file does not need to be Unicode for what he is trying to insert. – Tom Wijsman Mar 25 '12 at 13:28
1  
This answer is the correct one. – Gras Double Feb 10 '14 at 13:14

Take a look at this website, it helped me with this problem: “The specified file is not a registry script” – How encoding can ruin your morning

Turns out that encoding can ruin your morning. Taking a look at the message I saw the “… only import binary registry files from …” and I thought “Why does this thing think it’s binary?”. Why, indeed. I opened the file back up in TextPad and rather than just hitting Ctrl+S or Save, I chose "Save As". Doing so presented this menu, and I’ve highlighted my problem:

That’s right. Without me doing anything, TextPad was going to save this file as Unicode. Regedit expects to get .reg files that are ANSI encoded. So I changed the Encoding to ANSI, saved the file, ran it again, and everything worked fine. It caused me some frustration for a good 20 minutes, so hope this helps someone else out.

share|improve this answer

You can also use the REG utility to manipulate registry via command line, if it fits your needs.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .