Question Registry question

Boray

Member
Joined
Apr 8, 2010
Messages
5
Programming Experience
10+
Hello!

I'm new here and have a problem with associating file types. I don't only want to create them from scratch, but first delete the old ones to replace them with new ones. I manage to do it with the ones in ClassesRoot, but there is also stuff in HKEY_Current_User\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

So how do I remove that? I'm running the application as admin on Vista.

The following does not work:
My.Computer.Registry.CurrentUser.DeleteSubKeyTree("Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\." + ext)

...where ext is a string with something like txt or mp3....

The error says there are no subkeys, but if I use DeleteSubKey instead of DeleteSubKeyTree it says it can't do that because there are subkeys.
 
Tried this with the same result:

VB.NET:
        Dim cu As RegistryKey = Registry.CurrentUser
        Dim rk As RegistryKey = cu.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts", _
            RegistryKeyPermissionCheck.ReadWriteSubTree)

        rk.DeleteSubKeyTree(".d64")
        rk.Flush()
        rk.Close()
 
Back
Top