Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write the registry value without redirect in Wow6432Node

this code insert the registry value

Microsoft.Win32.RegistryKey key;
            key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION"); 
            key.SetValue("MyBrowser.exe", 8000);
            textBox1.Text = key.GetValue("MyBrowser.exe").ToString(); 
            key.Close();

in windows 32 bit work, but in 64 bit is inserted to wow6432node how to disable the redirect?

like image 460
Luca's Avatar asked Dec 12 '22 09:12

Luca's


1 Answers

You need to open the key using RegistryView.Registry64. You specify this in the OpenBaseKey method so you'll need to rejig your code a little.

like image 103
David Heffernan Avatar answered Dec 14 '22 21:12

David Heffernan