Hi again,
I have a database that writes to the registry in Windows XP but doesn't in Windows 7 (works with Server 2003 as well).
Below is an extract of the code I am using, but it doesnt' work with Windows 7.
Any help would be appreciated.
Oh, and yes, the keys are already there as I have a batch file to add all the structure beforehand
I have a database that writes to the registry in Windows XP but doesn't in Windows 7 (works with Server 2003 as well).
Below is an extract of the code I am using, but it doesnt' work with Windows 7.
Any help would be appreciated.
Oh, and yes, the keys are already there as I have a batch file to add all the structure beforehand
Code:
Private Sub Command1_Click() 'test button for now
myRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Niak32Software\timer\\TimerNewName"
If myRegKey = "" Then Exit Sub 'this is the registry key I want to modify
myValue = "test" 'test line to bypass all the testing it normally does
If myValue <> "" Then
RegKeySave myRegKey, myValue
End If
Dim stAppName As String
'at this point I check the registry and nothing is there under Windows 7
End Sub
Sub RegKeySave(i_RegKey As String, _
i_Value As String, _
Optional i_Type As String = "REG_SZ")
Dim myWS As Object
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'write registry key
myWS.RegWrite i_RegKey, i_Value, i_Type
End Sub