I'm trying to disable Internet Explorer 11 AutoComplete for usernames and passwords on forms using the Windows Registry in a c# application.
The following code works some times (browser stops asking to save passwords and the checkboxes in AutoComplete Settings is unchecked), and fails at other times (that is, no exceptions but the browser still asks if you want to save passwords, and the checkboxes in AutoComplete settings are checked).
My question: Is there another key that controls password saving, or is it perhaps failing due to the user's privileges? Or am I assigning the wrong value to the subkeys? Why would it work sometimes and fail silently others?
Another question: If a website is running in compatibility view, which displays webpages as if they were viewed by an earlier version of the browser, does IE11 then use the registry keys from the older versions (eg, HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\AutoComplete?)
// Keys I am manipulating:
// HKCU\Software\Microsoft\Internet Explorer\Main\FormSuggest Passwords
// HKCU\Software\Microsoft\Internet Explorer\Main\FormSuggest PW Ask
// others?
RegistryKey regKey1 = default(RegistryKey);
regKey1 = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);
regKey1.SetValue("FormSuggest Passwords", "no", RegistryValueKind.String);
regKey1.Close(); //are these values ok?
RegistryKey regKey2 = default(RegistryKey);
regKey2 = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);
regKey2.SetValue("FormSuggest PW Ask", "no", RegistryValueKind.String);
regKey2.Close();
Edit: I have since discovered several other registry items that appear related to Auto Complete, but it is unclear which version of Internet Explorer these apply to. It also seems very difficult to find information about IE 11 registry settings in general.
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\AutoComplete
HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel\FormSuggest
HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel\FormSuggest Password
Setting access control for the registry key might help to resolve your problem
example
string user = Environment.UserDomainName + "\\" + Environment.UserName;
RegistrySecurity regSecurity = new RegistrySecurity();
rs.AddAccessRule(new RegistryAccessRule(user,
RegistryRights.ReadKey | RegistryRights.WriteKey,
InheritanceFlags.None,
PropagationFlags.None,
AccessControlType.Allow));
RegistryKey regKey1 = null;
try
{
regKey1 = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main",
RegistryKeyPermissionCheck.Default, rs);
regKey1.SetValue("FormSuggest Passwords", "no",RegistryValueKind.String);
}
catch (Exception ex)
{
Console.WriteLine("\r\nUnable to read key: {0}", ex);
}
These keys are also accessed by Internet Explorer when internet options->autocomplete is loaded:
HKCU\Software\Microsoft\Internet Explorer\DomainSuggestion\Enabled
HKLM\Software\Microsoft\Internet Explorer\DomainSuggestion
HKCU\Software\Microsoft\Internet Explorer\Main\Use FormSuggest
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete
HKCU\Software\Policies\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete
Seems windows explorer and internet explorer share some autocomplete options.
You can use some registry monitoring tools to see what is being accessed in compatibility view. This is how I found these keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With