Changing Local security Policy programatically
-
Tuesday, November 24, 2009 11:16 AMhi
i want to change Local Security Policy "Interactive logon: do not require ctlr+alt+del" in c# how can i do this
Regards
Ehtsham
All Replies
-
Tuesday, November 24, 2009 4:11 PMDo you want to perform CTRL + ALT + DEL operation programatically?
OR:
Do you want to change Local Security Policy programatically?
Regards,
Jai -
Thursday, November 26, 2009 8:35 AMModerator
Hi,
We can enable/disable the option by modify the registry, here is some code snippet, hope it helps:
// CAD means "Ctrl + Alt + Del"
string valueName = "DisableCAD";
string subKeyPath = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(subKeyPath, true))
{
// set the value of "DisableCAD" to 0 to enable CAD when user login.
key.SetValue(valueName, 0x00000000, RegistryValueKind.DWord);
// or set the value of "DisableCAD" to 1 to disable CAD when user login.
// key.SetValue(valueName, 0x00000001, RegistryValueKind.DWord);
}
Thanks,
Eric
Please remember to mark helpful replies as answers and unmark them if they provide no help.- Marked As Answer by eryangModerator Monday, November 30, 2009 3:09 AM

