How could you edit a specific group policy using a batch file

Im working on over 700 computers in a school district and have written a small program that i intend to write to a cd. The program is set to autorun when the disk is inserted and prompt the screen resolution of the computer and what computer the building is in (the different school buildings). Afterwards the program will run a batch file that copies a default desktop from the disk and into the windows\web\wallpaper directory. It also replaces other files that have been customized for the school district. To finish changing the theme of the computer, i need to have the file make a few edits to the group policy and the registry. How would i be able to use the program to makes these changes? Would it all be written into the batch or would the batch have to initiate another file (like a registry file)?

asked Aug 27, 2010 at 1:12 Matt Shank Matt Shank 41 1 1 gold badge 1 1 silver badge 3 3 bronze badges

2 Answers 2

All the group policy editor does is set registry keys. If you can identify what keys are being set for the policy you want, you can use reg.exe to set those keys.

reg.exe add HKCU\Software\path\to\regkey\ /v valuename /d newvalue 
answered Jun 29, 2011 at 23:35 Ryan Bemrose Ryan Bemrose 9,216 1 1 gold badge 43 43 silver badges 55 55 bronze badges

Registry will work for the first user, but after a new user logs in, GP will change those settings for the new user.

To make deployment gp, do this: Set one machine's GP to the way you want it. Once you are done, goto C:\windows\System32\GroupPolicy and copy the contents. (note: this is a hidden file). On the next machines you want, just paste back in the file.

If you do this in a batch, you will have to run the batch as administrator to touch the C:\windows\system32 folder. (UAC, the bane IT)

answered Jan 21, 2015 at 21:13 CodePrime8 CodePrime8 31 4 4 bronze badges

Related

Hot Network Questions

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2024.9.4.14806