![]() All you need to do is use RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64) and you will overcome the registry redirection. I was writing a P/Invoke solution to this problem, but then I came across this. Using (RegistryKey rk = localMachineX64View.OpenSubKey(location)) RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Otherwise, if you're using an earlier version of the Framework then you need to use P/Invoke and call the function RegOpenKeyEx with the KEY_WOW64_64KEY flag from the WINAPI as described here.īut onto the solution that I used. NET 4.0 which provides a very clean solution for accessing the 64 bit registry from a 32 bit process. ![]() string MseLocation = Files\Microsoft Security Client\msseces.exe" Any assistance in discovering why would be much appreciated.įor the time being I am using the following as a substitute. If (Convert.ToString(productKey.GetValue("DisplayName")) Using (RegistryKey productKey = rk.OpenSubKey(subKey)) String location = (RegistryKey rk = (location))įoreach (string subKey in rk.GetSubKeyNames()) My Method: private static bool DoesMseExist() I'm able to see the keys of other programs in the same directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |