TechSupp Posted November 26, 2009 Posted November 26, 2009 Whats the best way to add a registry entry i.e. via a .reg file to computers on the network via a script? Must be simple to do but all the answers I seem to find onthe net seem to involve complex scripts. Sure I've done this before but age prevents me remembering howor where!
meastaugh1 Posted November 26, 2009 Posted November 26, 2009 I'd set the GP startup script executable to %windir%\system32\reg.exe and the parameter as IMPORT regfilename.reg. Then just drop regfilename.reg into the group policy startup script files folder.
jsnetman Posted November 27, 2009 Posted November 27, 2009 Or simply "regedit.exe /s myregfile.reg" in a startup batch file. The reg file being in the startup scripts folder.
SimpleSi Posted November 27, 2009 Posted November 27, 2009 I do it like jsnetman for fixed registry entries. I use this type syntax for variable ones set WPKGROOT=\\server2\icttech\wpkg set PACKAGES=\\server2\icttech\wpkg\packages set WPKGBASEIP=10.81.63 c:\windows\system32\Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v WPKGROOT /t REG_SZ /d "%WPKGROOT%" /f c:\windows\system32\Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PACKAGES /t REG_SZ /d "%PACKAGES%" /f c:\windows\system32\Reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v WPKGBASEIP /t REG_SZ /d "%WPKGBASEIP%" /f regards Simon 1
ZeroHour Posted November 27, 2009 Posted November 27, 2009 If I were you I would just use group policy preferences. Simple to deploy/manage as its just a GP and its free. 1
TechSupp Posted November 27, 2009 Author Posted November 27, 2009 Any deatils of how you go about that via GPO? otherwise I'll just go with the quick and easy script option, Thanks
ChrisH Posted November 27, 2009 Posted November 27, 2009 Computer Configuration > Windows Settings > Security Settings > Registry. Right click context menu for options 1
TechSupp Posted January 29, 2010 Author Posted January 29, 2010 (edited) This may be resurecting an old topic but just looking at that GPO setting mine has a lock symbol on it and prevents editing, how do I remiove the lock? I presume its in another GPO setting thats overriding the policy I want to change as if I run the reg entry manually it tells me I'm not allowed to edit the registry. Where in the policy would this be set so I can unset it? Its OK, Think I've found it. Edited January 29, 2010 by TechSupp
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now