Deleting Registry Values not working?

THEKnet

New member
Joined
Aug 2, 2012
Messages
4
Programming Experience
1-3
Hi,

I haven't done much with VB.net for a long while. I'm trying to create a program I can distribute to remove a key from several hundred computers' registry's.

Here's my code:

VB.NET:
Module Module1


    Sub Main()


        Console.Out.WriteLine("Deleting Key")


        My.Computer.Registry.SetValue("HKEY_CLASSES_ROOT\CLSID\{6C467336-8281-4E60-8204-430CED96822D}\InprocServer32", "", "")


        Console.Out.WriteLine("Value Deleted")


        Console.ReadLine()
    End Sub


End Module

I'm running the program as an administrator. No errors are thrown but the value doesn't get touched.

Any help would be greatly appreciated.
 
Last edited:
If no exception is thrown it means the operation is successful. That method even creates all the keys and name-value pair if they don't exist, so either you're looking at the wrong place or haven't refreshed the view in Regedit to see the new value.
 
If no exception is thrown it means the operation is successful. That method even creates all the keys and name-value pair if they don't exist, so either you're looking at the wrong place or haven't refreshed the view in Regedit to see the new value.

Registry.png

I set the program to show the before and after values and they were both correct. So it is setting the value. However, the image above shows after I've set the value, after a refresh, even after closing it down.
 
There are various registry values which might be considered to be protected in that the associated program will simply rewrite it if it's deleted. As this appears to be an MS Office setting I would think it highly likely that this is one of them. Why do you need to delete it?
 
There are various registry values which might be considered to be protected in that the associated program will simply rewrite it if it's deleted. As this appears to be an MS Office setting I would think it highly likely that this is one of them. Why do you need to delete it?

It removes the Sharepoint Link from the right click menu. We need to remove it because once the Sharepoint Synchronisation program has started you can't get rid of it.

If I apply a .reg file to it the value changes and stays changed for everyone who logs onto that machine. We can't send it out through GPO because it won't change it, so I need to create a program that will remove it instead. This way we can deploy it across the entire site.
 
Back
Top