marceld
(Lurker)
2006-04-25 10:46 AM
loading registry.reg file when login

Hello

first off all WELCOME everyone!
Iam new on this forum!

For my project @ school i have to make changes in the Windows XP desktop and more... the onyl way to do them all was with a registry file.. When i run it, it all works perfect. But my question is:
How can i load this with kixtart on a network ??

i found this is this ok and does it work ?:

;
; laadkey.KIX
; dit zorgt ervoor dat de keys geladen worden in het register.
;

break on

$ReturnCode = LoadKey("HKEY_CURRENT_USER\EZReg", "c:\marcel\netwerk-policy-settings.reg")
If $ReturnCode = 0
? "Key loaded...."
Endif

i saved this as a netwerk-policy-settings.reg.

So does this work?????

Thanks alot !


ChristopheM
(Hey THIS is FUN)
2006-04-25 11:32 AM
Re: loading registry.reg file when login

hi,

LoadKey is a function to load a registry file like ntuser.dat, not to import a .reg file.

You need a command like :

Code:
$regfile = ""c:\marcel\netwerk-policy-settings.reg"
shell 'regedit /s "'+$filename+'"'



Take care that with this method, parameters are applied definitively in the registry.

For non-permanent modifications, you should use AD policies.


Mart
(KiX Supporter)
2006-04-25 11:45 AM
Re: loading registry.reg file when login

Depending on what keys should be written to importing a registry file will fail or will be successful. A regular user can not write to for example the HKEY_LOCAL_MACHINE part of the registry in Win2K and up.
It might be an option to use writevalue. It all depends on what you want to write, where to write it, who is going to do the changes and how many registry changes should be done.


marceld
(Lurker)
2006-04-25 01:02 PM
Re: loading registry.reg file when login

Thx you 2
I testen those registry settings on my own workstation that is in a domain and they worked for me. it are settings like :
Dont group simular programma's in the taskbar and add some defualt icons on desktop etc.
I have all of those in a reg file as you know and i just want it to load when a user logs in.

so this :

$regfile = ""c:\marcel\netwerk-policy-settings.reg"
shell 'regedit /s "'+$filename+'"'

Should work then with kixtart ?

thanks alot!


Mart
(KiX Supporter)
2006-04-25 01:27 PM
Re: loading registry.reg file when login

It still depends on the keys you want to write to.
Two questions:

- Are you and/or your users (local) administrator? Regular users can not write to for example HKEY_LOACL_MACHINE in Win2K and up admins can.
- Do all users have access to the c:\marcel folder? It would be easier to place the .reg file on the netlogon share so users can access it without changing permissions on folders.