Waspy
(Just in Town)
2010-01-07 11:28 AM
Windows 7: Write RegValue failed

Hello,

we use the LoginScript to write some values to the Registry.
In my migration tests to Windows 7 I notice, that it is not longer allowed to write to HKLM in user/admin-context.

e.g.
 Code:
WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer","EULA","1","REG_DWORD")


Error code: 5

I think this is about the new UAC/elevated rights...

How it is possible, to write via LoginScript to HKLM ?
Currently, my users have local admin rights.
kix32.exe and KiX scripts are located on \\dc-server\netlogon share.


best regards
Waspy


Kdyer
(KiX Supporter)
2010-01-07 09:26 PM
Re: Windows 7: Write RegValue failed

Waspy,

Welcome to the board!

Please check -
FAQ Forum here..
Specifically, Installing an Application as an Admin
And.. HOW-TO: Running scripts with ADMIN powers

HTH,

Kent


Radimus
(KiX Supporter)
2010-01-07 09:30 PM
Re: Windows 7: Write RegValue failed

I think that if you run it as a logonscript it will work correctly... Logonscripts run with elevated privledges that bypass UAC.

I am running it on win7 x64 and it works fine (so far) when run as the logonscript, when I run it via CMD, there are a number of items that do not (protected directories, reg values, etc) I am admin as well.


Waspy
(Just in Town)
2010-01-08 01:41 PM
Re: Windows 7: Write RegValue failed

Thanks for your reply.

 Originally Posted By: Radimus
I think that if you run it as a logonscript it will work correctly... Logonscripts run with elevated privledges that bypass UAC.


Unfortunately it doesn't work in a LoginScript ...
Where it is documented that LoginScripts runs with elevated privledges that bypass UAC ?
That would be really new for me.

In the ADUC, we set on the Profile-tab of an account the LoginScript login.cmd.
The LoginScript itself contain besides a few statements only
kix32.exe login_department.kix

Any other ideas ?


best regards
Waspy


AllenAdministrator
(KiX Supporter)
2010-01-08 03:37 PM
Re: Windows 7: Write RegValue failed

He meant a GPO Script.