Randy

Randy

  • NA
  • 1
  • 0

C# and a 64bit Registry from 32bit system

Sep 30 2009 5:30 PM
Ok I have done a ton of reading on my issue and am still no closer to a solution but am actually more confused.

I am writing a app that needs to query 32 bit and 64 bit windows server registries.  However I am having issues with interacting with a 64bit windows registry from a 32bit guest when running my app. I know that the app gets "reflected" or something to the wow6432node key which is my issue since there is some info in the true 64bit registry Software hive I need to get.

Now I have read solutions for using some C++ like dll file and turn off wow64_key64... thing however that seems like allot of work for really a simple task and to boot I am still pretty green with .net development. I am looking to get an answer why I can write a powershell script using pretty much the same commands I would in C# and run them from the same workstation and get to the info I need in the true registry and then turn around and run my C# .net code and get a totally different answer.

I thought power shell used the same .net libraries and what not. So after that long winded rambling I am looking to see if someone can provide me an answer as to why the powershell script does what I want and the C# code does not and if there is a way to get C# to work like powershell. If not then I am just going to bite the bullet and just wrap the powershell code in with the C#. Not pretty but gets the work done.