If you need to use the REG program (instead of using PowerShell to query / reset the registry - or even just do it in the C # program itself), probably the best thing you are going to get is to let it unload into a temporary file, then drag the contents of the file back to the standard version and write it to your C # program this way:
$guid = [Guid]::NewGuid().ToString("N")
REG EXPORT HKCU\Software\Microsoft\Windows "$env:temp\$guid" | Out-Null
Get-Content "$env:temp\$guid"
Remove-Item "$env:temp\$guid"
If you did not know: using PowerShell, you can navigate the registry as if it were part of the file system. Perhaps this is useful in some other way?
cd HKCU:\Software\Microsoft\Windows
dir
source
share