I am trying to create a folder under the "HKEY_CLASSES_ROOT" in the Registry Editor.
I run this code but I cant find that "TestFolder" was created here.
I wonder if I am doing this correctly ?

Microsoft.Win32.RegistryKey Test = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("TestFolder");

I found this way in C++. It seems to work.

using namespace Microsoft::Win32;
using namespace System::Security::Permissions;
using namespace System::Reflection;

[assembly:RegistryPermissionAttribute(SecurityAction::RequestMinimum, ViewAndModify = "HKEY_CLASSES_ROOT")];


//At last, install the registrykey                
 Microsoft::Win32::RegistryKey^ Test = Microsoft::Win32::Registry::ClassesRoot->CreateSubKey("TestFolder");

I am trying to create a folder under the "HKEY_CLASSES_ROOT" in the Registry Editor.
I run this code but I cant find that "TestFolder" was created here.
I wonder if I am doing this correctly ?

Microsoft.Win32.RegistryKey Test = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("TestFolder");

My intention to createsubkey in the Registry Editor (ClassesRoot) is that a software I have done will also need an existing subkey.

So in order for the software to work, the software will first control that the subkey exists.

Now is my question, is it really a good idéa to be dependent of a subkey ?

What I am thinking of is that if it is 100 % guarantee that the external source as in this case an ASP.net webpage will get the permission to createsubkey on the users computer ?

When the user is downloading the setup.exe file, the Webpage will create this subkey. Will The Webpage always get permission for every user ?

I inted to create a subkey on a users computer that a software will check if it exist in order to make the software startup and work.

What I wonder is if that is a good idéa ?

What I am thinking of is the Security Permissions. Is it 100 % sure that it will be possible to create a Subkey on every Users computer or is there a more correct method ?

I am quite confused here...

Thank you...

This article has been dead for over six months. Start a new discussion instead.