We help IT Professionals succeed at work.

Login script to modify HKEY Current User registry entry does not work

drock1978
drock1978 used Ask the Experts™
on
The following batch file is set up to modify a registry key under HKEY Current User:

regedit.exe /s \\beesley\software\visualregsitryfile\visual.reg.

If I run the batch file while logged into my Windows 7 computer, I get the UAC prompt (because I do not have administrative rights on my computer.  I am the network admin and as a best practice I don't even give myself local admin rights) and I enter my network username and password.  The script adds the registry values contained in the .reg file just fine.  However, if I use this as a login script, when I log into the computer, the registry values are not added.

I believe a couple of things are causing the problem:

1.) The user is not a local administrator and even though the user can make changes to this particular key, they are prompted by the UAC to enter their username and password.
2.)  I temporary gave myself admin rights to the computer and the login script still did not make the changes to the registry. Is this because you just cannot make a login script that will make changes to the HKEY current user registry?

This login script is being deployed as a login script in a group policy.  I have already verified that the computer and user are in the OU that this Group Policy is being applied to and I also ran GPRESULT /R to make sure this group policy was listed and it was.

I am running Server 2008.

Thanks for your help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
I think this is looking at your issue from an "Outside the Box" point of view.  The second last post may be your answer.  This is on Server 2003 /Win XP, but could work for you.  I have Win 7 and the NTUSER.dat file is available in my %userprofile% not Documents & Settings as is for XP.

You could always do a backup of the registry and try it.  Fundamentally, this sounds like what you are trying to do.

Add registry entry for HKey_current_user upon login
Network Engineer
Commented:
You should set the registry settings using the registry section under group policy preferences. This is a new capability introduced with Vista, and back ported to XP SP3 with the Group Policy Preferences extensions installed.