none
delete directory in registry RRS feed

  • Question

  • title?

    i am trying it now but it wont work:

    RegistryKey key = Registry.LocalMachine;
                RegistryKey rk = key.OpenSubKey(@"HKEY_CURRENT_USER\Software\ROBLOX Corporation", true);
                rk.DeleteSubKeyTree("Roblox", true);

    Sunday, May 5, 2019 9:32 AM

Answers

  • You have put HKEY_CURRENT_USER inside LocalMachine...

    If it is in HKEY_CURRENT_USER, you can do something like :

    using (RegistryKey rk  = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64))
    {
        RegistryKey sk = rk.OpenSubKey(@"Software\ROBLOX Corporation", true);
        sk.DeleteSubKeyTree("Roblox", true);
    }

    • Marked as answer by Ahron321 Sunday, May 5, 2019 9:59 AM
    Sunday, May 5, 2019 9:57 AM

All replies

  • You have put HKEY_CURRENT_USER inside LocalMachine...

    If it is in HKEY_CURRENT_USER, you can do something like :

    using (RegistryKey rk  = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64))
    {
        RegistryKey sk = rk.OpenSubKey(@"Software\ROBLOX Corporation", true);
        sk.DeleteSubKeyTree("Roblox", true);
    }

    • Marked as answer by Ahron321 Sunday, May 5, 2019 9:59 AM
    Sunday, May 5, 2019 9:57 AM
  • Thanks!!
    Sunday, May 5, 2019 9:59 AM