I'll give you my custom function for creating file associations. You should be able to figure it from that:-
VB Code:
Public Function AddAssociation(ByVal fExt As String, ByVal appName As String, ByVal appPath As String) As Boolean Try Dim extKey As RegistryKey = Registry.ClassesRoot.CreateSubKey(fExt) extKey.SetValue("", appName) Dim appKey As RegistryKey = Registry.ClassesRoot.CreateSubKey(appName) appKey.SetValue("", appName & " File") Dim shellKey As RegistryKey = appKey.CreateSubKey("shell") Dim openKey As RegistryKey = shellKey.CreateSubKey("open") Dim commKey As RegistryKey = openKey.CreateSubKey("command") commKey.SetValue("", appPath & " %1") Return true Catch Return False End Try End Function




Reply With Quote