copy a reg-key between two computers

  • Thread starter Thread starter Martin Rådbo
  • Start date Start date
M

Martin Rådbo

Probably easy but I can't figure out how.

Two computers running Windows 2000 Server, pc1 and pc2, both domain
controllers for the same domain.
We often add a share (we share a folder) at pc1 with some permissions. I
would like a simple way of getting the same share to be added to pc2.

One way is to do it manually. Another way is to export the registry key
containing share information from pc1 and go to pc2 and import it. Both
methods needs a lot of manual work and it is easy to forget something.

One idéa is to use the regedit command in a batch file to first export from
pc1 and then import to pc2, but I do not know how to be able to run the
batch file from either computer and at the same time be able to reach the
other computers registry in the batch script.

Any other idea?

Regards
Martin Rådbo
Teknologia
 
Probably easy but I can't figure out how.

Two computers running Windows 2000 Server, pc1 and pc2, both domain
controllers for the same domain.
We often add a share (we share a folder) at pc1 with some permissions. I
would like a simple way of getting the same share to be added to pc2.

One way is to do it manually. Another way is to export the registry key
containing share information from pc1 and go to pc2 and import it. Both
methods needs a lot of manual work and it is easy to forget something.

One idéa is to use the regedit command in a batch file to first export from
pc1 and then import to pc2, but I do not know how to be able to run the
batch file from either computer and at the same time be able to reach the
other computers registry in the batch script.

Any other idea?

Regards
Martin Rådbo
Teknologia
Install REG.EXE from the Support Tools on the server CD-ROM to PC2.

Run the following on PC2.

@echo off
REG EXPORT \\PC1\HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares "%TEMP%\PC1Share.reg"
net stop LANMANSERVER
REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares /F
REG IMPORT "%TEMP%\PC1Share.reg"
net start LANMANSERVER
del /q "%TEMP%\PC1Share.reg"

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Back
Top