12-18-2011, 02:53 PM
Import
Function
Enable Task Manager
Disable Task Manager
Code:
Imports Microsoft.Win32
Function
Code:
Function ToggleTaskManager(ByVal State As Integer)
Try
Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
If State = 0 Then
systemRegistry.SetValue("DisableTaskMgr", 1)
systemRegistry.Close()
ElseIf State = 1 Then
systemRegistry.SetValue("DisableTaskMgr", 0)
systemRegistry.Close()
End If
Return True
Catch ex As Exception
Return False
End Try
End Function
Enable Task Manager
Code:
ToggleTaskManager(1)
Disable Task Manager
Code:
ToggleTaskManager(0)