code to disable ctrl+alt+del key using .net
Use this code in .net for disable A-C-D
Use this code in .net for disable A-C-D
Dim regkey As Microsoft.Win32.RegistryKey
Dim subkey As String
subkey = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
regkey = My.Computer.Registry.CurrentUser.CreateSubKey(subkey, Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree)
regkey.SetValue("DisableTaskMgr", 0)
To Again enable A-C-D use this
subkey = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
regkey = My.Computer.Registry.CurrentUser.CreateSubKey(subkey, Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree)
regkey.SetValue("DisableTaskMgr", 1)
after this Restart PC and use this Function
Public Sub RestartComputer()
Dim t As Single
Dim objWMIService, objComputer As Object
'Now get some privileges
objWMIService = GetObject("Winmgmts:{impersonationLevel=impersonate,(Debug,Shutdown)}")
For Each objComputer In objWMIService.InstancesOf("Win32_OperatingSystem")
t = objComputer.Win32Shutdown(2 + 4, 0)
If t <> 0 Then
MsgBox("Error occurred!!! Restart System Manually")
Else
'LogOff your system
End If
Next
End Sub