create registry key, not the usual

.net, c#

Solution

Not sure if this is what you are trying to do, but you may use `Registry.SetValue(string keyName, string valueName, object value, RegistryValueKind valuekind)` to create Keys/Subkeys and its values.

Example

Registry.SetValue(@"HKEY_CURRENT_USER\Software\Picrofo Software\", "", ""); //Tree
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Picrofo Software\Subkey", "", ""); //Branch
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Picrofo Software\Subkey", "Value Name", "Value", RegistryValueKind.String); //Branch's value
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Picrofo Software\Another Subkey", "", ""); //Branch

This will create a key in `HKEY_CURRENT_USER\Software\` with the name `Picrofo Software`. Then, creates a subkey in the key we've created with the name `Subkey` and sets a value of name `Value Name` and its value `Value` of type `String`. Finally, creates another subkey in `Picrofo Software` with the name `Another Subkey` which has no specific value.

Thanks, I hope you find this helpful :)

Problem

Been googling but I cant find out how to create a registry key itself, not a subkey string value as is seen in all the tutorials. The registry is like a tree with branches and leaves, I want to create a new branch and add a leaf ``` |tree |-branch | |-my branch |-branch ``` Thanks for any help More info to make it clearer as i'm being pointed to what I dont need ;) you click on one of the registry keys, next to it is an arrow pointing down, you click it and you get more keys maybe with another arrow pointing down for more ketys, well thats what I'm trying to create a "folder" looking thing. I'm not sure how else I can explain but `CreateSubKey` does nothing like that for me: ``` Key = Registry.CurrentUser.CreateSubKey("SOFTWARE\Microsof\game\addons\myaddons"); ``` Now, when I check it there is no folder-like icon named `myaddons`

Original source