So I've got this little issue...
I need to delete a key under Enum...you may be asking why...Don't.
But
RegKey = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM", _
True).OpenSubKey("CurrentControlSet", _
True)
Try
rs.AddAccessRule(New RegistryAccessRule(user, _
RegistryRights.FullControl, _
AccessControlType.Allow))
RK2 = RegKey.OpenSubKey("Enum", True)
RK2.SetAccessControl(rs)
Catch ex As UnauthorizedAccessException
Console.WriteLine(vbCrLf & "didn't work...", ex.Message)
End Try
Doesn't seem to put the appropriate permissions onto the key
With the True for OpenSubKey it says can't open subkey, if I switch that to false it doesn't even try to work.
I know my syntax is working due to the fact of changing it to another key I can change the permissions.
Also I can change the permissions of the Enum key manually through regedit.
So basically it looks like I need to open the key to put on the permissions but I can't open the key until I put the permissions on it...
I need to delete a key under Enum...you may be asking why...Don't.
But
RegKey = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM", _
True).OpenSubKey("CurrentControlSet", _
True)
Try
rs.AddAccessRule(New RegistryAccessRule(user, _
RegistryRights.FullControl, _
AccessControlType.Allow))
RK2 = RegKey.OpenSubKey("Enum", True)
RK2.SetAccessControl(rs)
Catch ex As UnauthorizedAccessException
Console.WriteLine(vbCrLf & "didn't work...", ex.Message)
End Try
Doesn't seem to put the appropriate permissions onto the key
With the True for OpenSubKey it says can't open subkey, if I switch that to false it doesn't even try to work.
I know my syntax is working due to the fact of changing it to another key I can change the permissions.
Also I can change the permissions of the Enum key manually through regedit.
So basically it looks like I need to open the key to put on the permissions but I can't open the key until I put the permissions on it...