0

How do I set a value to the registry that is NOT in HKEY_CURRENT_USER?

My.Computer.Registry.CurrentUser.CreateSubKey("..\HKEY_CLASSES_ROOT\")

This above only puts it in a folder named ..

Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
Visual Magic
  • 479
  • 6
  • 13
  • That's not how the registry works; you need to be in a hive. – SLaks Dec 26 '13 at 21:59
  • @SLaks Okay, : I have no idea what that means. – Visual Magic Dec 26 '13 at 22:00
  • Open regedit and look around. The five `HKEY_*` things are called _hives_; everything in the registry is inside them. – SLaks Dec 26 '13 at 22:03
  • @SLaks Oh ok I never knew they were not just *folders* thx but is it possible to create inside em? – Visual Magic Dec 26 '13 at 22:04
  • 4
    bad idea to mess with the registry if you do not understand it first as you can make your computer unusable really fast. May want to do a bit of reading first. http://support.microsoft.com/kb/256986 – Sorceri Dec 26 '13 at 22:25
  • Thank you @Sorceri it's just that you need to access the ClassesRoot to add stuff to the Windows right click menu shell but whatever guys i figured it out – Visual Magic Dec 26 '13 at 22:32
  • @Supercoder: You can do that without needing admin by writing to `HKCU\Software\Classes`. – SLaks Dec 26 '13 at 22:41

1 Answers1

1

Use My.Computer.Registry.LocalMachine to access HKEY_LOCAL_MACHINE.

If that does not solve your problem, please let me know in comments.

Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151