A .NET library that can be used to read and write .reg
files, and import into or export from
the Windows Registry.
Putting the functionality together, one can recreate the REG.EXE IMPORT
and REG.EXE EXPORT
commands easily.
In short all native registry types (and formats) that are represented by the RegistryValueKind
-type are supported.
As file format, currently only the Windows Registry Editor Version 5.00
signature is supported (which is the
current format since Windows 2000). The older REGEDIT4
format is not currently supported.
Also, please refer to RegFileReaderTests.cs
for currently supported data types and .reg
file formats.
IEnumerable<RegistrySubKeyCommand> commands;
using (var reader = new RegFileReader(fileName))
{
commands = reader.Read();
}
using (var writer = new RegFileWriter("somefile.reg"))
{
writer.Write(commands);
}
var processor = new RegCommandProcessor(RegistryView.Default);
processor.Process(commands);
var extractor = new RegCommandExtractor(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework", RegistryView.Registry64);
var commands = extractor.Extract();