Chuck B wrote:
I am modifying remote registries for about 150 computers. Is there any easy
way in C# to do a remote registry backup?
How about something like this:
using Microsoft.Win32;
private void openSubkey(string keyName, string remoteName)
{
RegistryKey regKey;
try
{
// Open registry on a remote computer.
regKey = RegistryKey.OpenRemoteBaseKey(
RegistryHive.LocalMachine, remoteName).OpenSubKey(keyName);
}
catch(IOException ex)
{
printOutput(string.Format("\n{0}: {1}",
ex.GetType().Name, ex.Message));
return;
}
if (regKey != null)
{
...
// Close the registry key.
regKey.Close();
}
}
Of course you'll have to be logged-in as an administrator for those
computers.
Eric