public static bool removeValue(RegistryKey mainKey, string subKey, string valueName) { RegistryKey the_Reg; try { the_Reg = mainKey.CreateSubKey(@subKey); the_Reg.DeleteValue(valueName); the_Reg.Close(); } catch (Exception e) { return false; } return true; }