Home > Mobile >  Open Regedit with admin privileges to see HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
Open Regedit with admin privileges to see HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node

Time:01-29

I tried it as follows:

  System.Diagnostics.ProcessStartInfo process = new System.Diagnostics.ProcessStartInfo {
    Arguments        = "",
    FileName         = "regedit.exe",
    UseShellExecute  = true,
    Verb             = "runas",
    WorkingDirectory = Environment.CurrentDirectory
  };
  try {
    System.Diagnostics.Process.Start(process);
  } catch {
    // error handling
  }

The C# app I am running the code from is elevated and opens Regedit but neither does it prompt for UAC nor is HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node visible. That key is only visible when I open regedit manually.

What am I doing wrong?

CodePudding user response:

The issue is resolved.

As in my app the platform was set to "Any CPU" it run as 32 bit process and therefore the call of regedit.exe also only shows the 32 bit registry entries. By changing my app platform explicitely to "x64" the 64 bit registry opens and the special 32 bit path (HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node) within the 64 bit registry is existing and showing up as expected.

I was confused as within a 32 bit app you are able to access the 64 bit registry programmatically when using RegistryView.Registry64. More on that here. But unfortunately, you are not able to open the 64 bit registry explorer by a 32 bit application.

  •  Tags:  
  • Related