This thread is a bit old bit if anyone else ends up here by googling this works.
- Set LastKey to your path you want regedit to open in
- Launch regedit.
Example:
var registryLocation = "Your key here";
var registryLastKey = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit";
try
{
Registry.SetValue(registryLastKey, "LastKey", registryLocation); // Set LastKey value that regedit will go directly to
Process.Start("regedit.exe");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}