If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Windows 7 and Reg Functions..

I haven't tried on windows 7, but my guess is it will be in the "Local Machine" or the "Users". I would seriouly take a look at avoiding the registry all together. Check out the Application Settings. You can set for "Application" or "User" settings. So Application settings would be for things like Database Server name... and User settings would be color/email address/... settings.

Re: Windows 7 and Reg Functions..

Sorry ... regkeys is a custom type that i built ..

Code:

Public Class Regkeys
Private _RegType As Reg_type
Private _KeyLoc As String
Private _KeyName As String
Private _KeyVal As String
Private _Change As Boolean
Public ReadOnly Property RegType() As Reg_type
Get
Return _RegType
End Get
End Property
Public ReadOnly Property KeyLoc() As String
Get
Return _KeyLoc
End Get
End Property
Public ReadOnly Property Keyname() As String
Get
Return _KeyName
End Get
End Property
Public Property KeyVal() As String
Get
Return _KeyVal
End Get
Set(ByVal value As String)
_KeyVal = value
_Change = True
End Set
End Property
Public ReadOnly Property Change() As Boolean
Get
Return _Change
End Get
End Property
Protected Friend WriteOnly Property Changed() As Boolean
Set(ByVal value As Boolean)
_Change = value
End Set
End Property
Protected Friend Sub LoadReg(ByVal RegType As Reg_type, ByVal KeyLoc As String, ByVal Keyname As String, ByVal Keyval As String)
_RegType = RegType
_KeyLoc = KeyLoc
_KeyName = Keyname
_KeyVal = Keyval
_Change = False
End Sub
End Class

Re: Windows 7 and Reg Functions..

Well if it worked before, then could it be a permission and/or ownership issue?

I have had a problem with the default security configuration of Win 7.
When it's first installed, the TrustedInstaller has ownership and full control over certain registry keys, and possibly sub keys.
Administrators do not have full access yet, until you gain ownership of the key. Then you can give yourself full access.

Manually if you are logged into an adminstrator/user account.
Open regeditRight click a registry key
Choose Persmission from the menu
Click the Advanced button below
Click the Owner tab
Choose Administrators as the owner and Apply, OK
Click checkbox for Full Control, with Administrators selected.Apply Ok

I've got a clean automation routine for that using my Sendkeys.
It's the best solution I've found yet.
Stable on Vista and Win7 (32-64 bit)
No other solutions i found, can do this with the UAC security on.
Even microsofts SubInACL.exe fails to gain ownership on Win7 64 bit.

You can slow the process down too, so that the user is asked at each step with a messagebox, or text to speech.
That way you blend it right into the built in security of the OS without appearing to be violative.

Would you like the administrator(yourself) to gain ownership of this registry key?
Would you like the administrator to gain full control over this registry key?

It could be even more verbose, and explain each window, and how one would repeat the operation manually.

Make sure that you are the "owner" of the key before modifying key permissions as a test. Only if you are the owner you will be able to undo possible mistakes. This is how to take ownership of a registry key (to the extent that your permissions allow it):