How to create registry key of type REG_NONE?

21,337

I also needed to create a REG_NONE key in HKCR.

Using regedit I found an existing file association within HKCR that had a REG_NONE key under its OpenWithProgIDs branch (e.g. HKCR\.mp3\OpenWithProgIDs). I exported this registry to a .reg file.

Then, I used notepad to edit the exported file and changed the branch to match the location where I wanted the REG_NONE key. I deleted all the other keys listed except the one REG_NONE key I wanted. If you need to rename the REG_NONE key do that as well.

Import the file back into your registry and it will add the new key value as REG_NONE.

The .reg file looks like:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\..etc..\keyname]
@=hex(0):

Change ..etc..\keyname to the actual key name. @=hex(0): is the line which creates the REG_NONE element.

Share:
21,337

Related videos on Youtube

Piotr Dobrogost
Author by

Piotr Dobrogost

se2021 at p.dobrogost.net

Updated on September 18, 2022

Comments

  • Piotr Dobrogost
    Piotr Dobrogost almost 2 years

    Information on files' associations are stored in HKLM\SOFTWARE\Classes and HKCU\SOFTWARE\Classes Windows' registry branches (among others). Each entry there can have OpenWithProgIDs key which adds programs named in it's values to the list of programs accessible from Open With entry in the context menu. Many of these keys have REG_NONE type. However regedit doesn't allow to create keys of this type - this type is absent from the list of key types available under New entry of the context menu.

    How can I create a registry key of type REG_NONE to add new program to the list or to recreate previously deleted key?

    • MaQleod
      MaQleod almost 13 years
      You can do so with the Registry.SetValue method in .net: msdn.microsoft.com/en-us/library/3dwk5axy.aspx Explanation of types here: msdn.microsoft.com/en-us/library/…
    • MaQleod
      MaQleod almost 13 years
      It might be best if you explain how you need to create the key or why, this question is likely to be closed as not constructive because it does not pose a question to a problem and does not specify any conditions or anything you have tried already. It is difficult to give an answer when no real question has been asked.
    • 100rabh
      100rabh almost 13 years
      As @MaQleodmentioned, please be specific in your question and add some more details. Flag for reopening once done
    • Lance Roberts
      Lance Roberts almost 13 years
      I'm not sure why anyone would think this question isn't specific enough. And there are many good questions on Super User that don't deal with a user's specific problem, they just ask a question. Some have even been highlighted as top questions. Like this one.