Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

backing up registry tweaks

Status
Not open for further replies.
Nov 8, 2004
23
US
We are looking for a solution to backup our users' registry tweaks for many users using the least effort. Is there a quick way to do this without having to export on each machine individually?
 
I don't know of a real easy way to do this because using NTbackup you cannot backup remote system states. You also cannot use reg.exe to export remote hives. However, you could use one of these methods in a somewhat automated way, but it takes some initial work.

Option 1: Create a backup selection file using ntbackup, copy it to each computer and then schedule the backups using the .bks. This may be prohibitive because of available space, however.

Option 2: Copy reg.exe to a shared network location, or to the individual boxes. Create a batch file to export the registry keys you suspect are being changed, and schedule that using AT or Task Scheduler to run periodically. Command line for that would be something like:

reg.exe HKLM\Software\Microsoft\Windows\CurrentVersion\Run computername.reg


To schedule remotely using AT:

AT \\computername 09:00 /Interactive /EVERY:M regback.bat

Would run regback.bat every Monday at 9:00 AM.
 
chipk, thanks for your response. Let me say what I need to provide more clarity.I have many users that have many different setups in their Microsoft Office products and other software. When their machine dies and we have to rebuild it I find myself spending a week or so getting their little "tweaks" just the way they like them. For example, their font sizes and colors in their Microsoft Outlook 2003 product and such; even the positions of their icons for some people. We can backup their my documents, their favorites, and the contents of their desktops easily but I thought that backing up their registry would possible put these changes back into place in a quick way. Am I correct in thinking this? I am not allowed to use Symantec Ghost products to accomplish my goal. Any suggestions?
 
Why not just backup the entire profile? That would get your Application Data and Local Settings folders under the user profiles, which contain most of that configuration information (.dot and .xlt templates, preferences, etc.).
 
works great except that it doesn't seem to copy printer installations. Do you know of a way of deploying printer installations and dialup settings?
 
thanks! I don't suppose you know how to deploy registry entries to multiple machine through group policy or some other method, do you?
 
Deploying registry entries is not all that hard once you practice it a little bit.

One way is to export a .reg file from a computer that has the desired keys/values. You do this by opening regedit, selecting the desired keys, going to File menu and clicking export. These can then be imported to other computers via batch file with the following command:

regedit /S importkeys.reg

This will take whatever is in importkeys.reg and merge it into the existing registry. You'd want to do this based on conditions, I wouldn't recommend doing this over and over on the same computer (i.e. from a logon script).

You can also use the reg.exe command to add/query/remove keys and values, but this is a little harder because you have to write the entire key location out in the batch file, rather than having it exported nicely from a known good registry.

This can ALSO be done with vbscript's regwrite function. I actually used it to deploy WSUS settings in a non-AD environment:

Option Explicit
Dim oWshShell
Set oWshShell = CreateObject("Wscript.Shell")
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\", 1 , "REG_SZ"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUServer", " , "REG_SZ"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUStatusServer", " , "REG_SZ"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\", 1 , "REG_SZ"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer", 1 , "REG_DWORD"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\AUOptions", 4 , "REG_DWORD"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallDay", 0 , "REG_DWORD"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\ScheduledInstallTime", 12 , "REG_DWORD"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers", 1 , "REG_DWORD"
oWshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate", 0 , "REG_DWORD"
 
so if I have 3 reg files that I want to push out to all my xp and 2000 clients all I have to do is put these into batch file in a login script:

regedit /S regfix1.reg
regedit /S regfix2.reg
regedit /S regfix3.reg

am I correct?
 
That would be correct. What I meant by conditional was that you should create a text file to reference the first time this runs, then each time this person logs in, it will not run these again until you change the file. Something like:

if exist %temp%\AlreadyDone.txt goto next
copy \\server\share\AlreadyDone.txt %temp%\
regedit /S regfix1.reg
regedit /S regfix2.reg
regedit /S regfix3.reg
:next
blah blah blah rest of your logon script
exit

The file obviously won't exist the first time this runs, so your regedit /S commands will all execute the first time. however, every time thereafter, the "if exist" command will see the file exists and go to :next, which skips over the regedit commands. You'll want to test this obviously on a test machine to make sure you have all your paths worked out. You will obviously have to tell the regedit command where those .reg files live, e.g.:

regedit /S \\server\share\regfix1.reg
 
chipk, I can't get the registry fixes to take. The client machine will show "running starting scripts..." in the login screen area but won't go the cltr-alt-del screen until about 2 minutes later. I think its because my reg fixes require user interaction. When you try to run the reg fix without using a script you have to click "run" to the security warning screen, then click "yes" to the "are you sure you want to add this?" screen, and then click "ok" to the "info has been successfully entered into registry" screen. Thats a lot of clicks and I think its timing out on me and moving on to the next execution. What do you think and how can i resolve this?
 
Which software is giving you the security warning? The /S option should be doing a "silent" install, i.e. suppress all questions. Also, if you're running startup scripts before users log in, some registry hives may not be loaded so that could give you issues as well. Why not run these as logon scripts instead?
 
Use RegSnap to help create your registry files. Take a snapshot of a clean registry from a machine you just installed. Make all your changes, then take another snapshot. Generate a differences file and push that to all the other machines or save it as a "restore" file for a given machine.

_____
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top