0

I got some problem..in C#

When I execute regedit.exe through my code, in x64 OS System it didn't show

HKLM\SOFTWARE\'wow6432node'

but when i execute regedit.exe through Window Key + R it show me wow6432node

how can i show up wow6432node? I don't know how to show up...

here is my code

        private void RegeditCall_Click(object sender, EventArgs e)
        {
            Process.Start("C:\\Windows\\regedit.exe");
        }

or

        private void RegeditCall_Click(object sender, EventArgs e)
        {
            Process.Start("regedit.exe");
        }
ppeterka
  • 20,583
  • 6
  • 63
  • 78

2 Answers2

0

Have you tried:

System.Diagnostics.Process.Start("regedit.exe");

I have tested this code in x64 machine with LinqPad and works.

Here is orginal topic

Edit

This can be useful http://www.rhyous.com/2011/01/24/how-read-the-64-bit-registry-from-a-32-bit-application-or-vice-versa/

Community
  • 1
  • 1
r.piesnikowski
  • 2,911
  • 1
  • 26
  • 32
  • @jeongseok-park I think this is connected with priviliges problem. But I only guess. What type of application you got? web or win forms? – r.piesnikowski Aug 14 '13 at 07:04
  • My allpication type is Winforms. and I want to see result of 'Process.Start("regedit.exe")' same as 'Window Key +R' but it's different. Execute regedit.exe through 'cmd.exe' also different with 'Window Key + R' result – JeongSeok Park Aug 14 '13 at 07:21
  • cmd.exe result is same as 'process.start' result – JeongSeok Park Aug 14 '13 at 07:28
  • @jeongseok-park Please do this: Open Event viewer in Control Panel -> System and Maintenance -> Administrative Tools -> Event Viewer -> Windows Logs -> Applications. After do action check for errors and put stacktrace. – r.piesnikowski Aug 14 '13 at 08:40
0

I've just had the same issue: Check your C# app isn't built for x86.

If a 32bit process executes regedit, then windows will launch the 32bit version of regedit. In this version HKLM\Software actually points to HKLM\Software\Wow6432Node.

If you use start -> run -> regedit (Assuming your running a 64bit version of windows), this will launch the 64bit version of regedit. Now you can see the HKLM (or HKCU) Wow6432Node key exists.

Richard
  • 2,994
  • 1
  • 19
  • 31