Deploy .reg script to the domain

Posted on 2012-08-14
Medium Priority
Last Modified: 2012-08-16
What's the best way to deploy a reg file to the domain?  Can I just stick it into the \\domainname\sysvol ?  Would that work?
Question by:Tiras25
  • 3
  • 2

Assisted Solution

comnuts earned 1500 total points
ID: 38294576
I don't think placing it there will work out of the box, moreover it will probably be applied continuously.

I would suggest to write a batch file and insert it into a group policy's Scripts (Startup/Shutdown) or Scripts (Logon/Logoff) depending on your needs. This will provide the elevated privileges and you can have the batch file to do the following:

1. Detect if the registry key already exists (VBS or Batch depending on needs)

Ref: http://www.daniweb.com/software-development/legacy-languages/threads/61011/check-if-registry-key-exists-in-batch-file or http://blogs.technet.com/b/heyscriptingguy/archive/2004/10/29/how-can-i-tell-whether-a-value-exists-in-the-registry.aspx

2. Apply registry file with /s option if not exists

Ref: http://support.microsoft.com/kb/310516

Once the batch file is tested, add it into group policy and apply to the computers that need it. (http://support.microsoft.com/kb/198642)
LVL 15

Assisted Solution

achaldave earned 500 total points
ID: 38294662
Or you can use group policy preferences to deploy registry settings
LVL 17

Author Comment

ID: 38296709
Hi guys, so to deploy via the Group Policy it only takes one key path.  My .reg has more than one.  
As for the bat file.  Renaming from .reg to .bat would that work?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

comnuts earned 1500 total points
ID: 38296794
Nope, renaming from .reg to .bat/.cmd won't work. You will need to keep that .reg file and use the command regedt32.exe /s "filename.reg" in order to merge the registry file into reg. Therefore you will have 2 files, one is the batch and the other is the .reg.

Sample Batch without checking if key exists
@echo off
regedt32.exe /s "\\MyFileServer1\Registry\Registry.reg"
LVL 17

Author Comment

ID: 38296939
Got it.  So if I stick that bat file into the \\domainname\sysvol that would apply anytime anyone login to the servers?

Assisted Solution

comnuts earned 1500 total points
ID: 38296998
There is this video that will go thru GPO for scripts to run at logon.

2:15 onwards - http://www.youtube.com/watch?v=ap7uM0yiEkY

I would probably put the batch file on the file share and browse to it on the GPO.

There are other ways to do this too, which involves the Show Files button where you can copy and paste the batch and reg file so that it will replicate to other domain controllers. Using this, you just need to type the batch filename instead of browse.

Remember to test it out in a test environment.

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A new hacking trick has emerged leveraging your own helpdesk or support ticketing tools as an easy way to distribute malware.
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question