Anyone out there know of a solution to import a reg file that applies changes to the hkcu without the user being logged in?
I've tried using an msi with repairs to triggered upon looking to see if the keys exist or not, and if not run the repair so that it inserts the hkcu reg hack.

Any ideas? Would be most appreciated.

fpthree [:)]
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Are you trying to trigger a repair or not?

Anyone out there know of a solution to import a reg file that applies changes to the hkcu without the user being logged in?
Have a look at the ModifyProfile utility.
http://www.jsifaq.com/SF/Tips/Tip.aspx?id=3970
You will have to run the utility against every user's NTUSER.DAT file.
Answered 03/02/2007 by: AngelD
Red Belt

Please log in to comment
0
It's a little complicated at first, and it's prone to errors on XP (since the stupid OS doesn't always release the registry when a user logs off). Anyway, you need to have the script run with administrative rights and then have it go through and load each of the user's NTUSER.dat files, and then make your change to the loaded hive.

I'm not sure if you wanna go this route so I'm just slapping some code up here to give you something to work with if you do (or anyone else stumbling across this post in the future).

Sub SetRegistry(strConsoleUserName)
' Loads the individual user profile hives and configures needed USER registry settings.
Dim strUserSID, Subfolder, UserPaths, strRegPath, strRegistryHive, strRegistryKey, strLocalSettingsFolder

On Error Resume Next

Set UserPaths = objFSO.GetFolder(strUserProfilesFolder).Subfolders

' Obtains the SID of the logged in console user.
strUserSID = GetUserSID(strConsoleUserName)

For Each Subfolder in UserPaths
strRegPath="USERS\CustomizeAdobeRegistry"
strRegistryHive = &H80000001
If Subfolder = (strUserProfilesFolder & "LocalService") Then
' Does nothing.
Else
If Subfolder = (strUserProfilesFolder & "NetworkService") Then
' Does nothing.
Else
If Subfolder = (strUserProfilesFolder & "Public") Then
' Does nothing.
Else
If Subfolder = (strUserProfilesFolder & "All Users") Then
' Does nothing.
Else
If Subfolder = (strUserProfilesFolder & strConsoleUserName) Then
If strUserSID = "" Then
strRegPath="CURRENT_USER"
Else
strRegPath="USERS\" & strUserSID
End If
End If

If strRegPath = "USERS\CustomizeAdobeRegistry" Then
strRegistryHive = &H80000003
' Loads the user profile's registry hive.
WshShell.Run ("reg.exe load HKEY_USERS\CustomizeAdobeRegistry """ & Subfolder & """\NTuser.dat"), 0, True
End If


'Sets some Adobe Reader 8.0 keys
WshShell.RegWrite "HKEY_" & strRegPath & "\Software\Adobe\Acrobat Reader\8.0\Updater\iUpdateFrequency", "0","REG_DWORD"

WshShell.RegWrite "HKEY_" & strRegPath & "\Software\Adobe\Acrobat Reader\8.0\AdobeViewer\EULA", "1","REG_DWORD"


If strRegPath = "USERS\CustomizeAdobeRegistry" Then
' Unloads the user profile registry hive.
WshShell.Run ("reg.exe unload HKEY_USERS\CustomizeAdobeRegistry"), 0, True
End If
End If
End If
End If
End If
Next
End Sub
Answered 03/04/2007 by: Lucid
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity