Monday, 11 May 2015

VB.NET :: How To Disable And Enable Task Manager In VB.NET

 Dim Regkey As Object
    Private Sub Form1_Load(ByVal sender As System.ObjectByVal As System.EventArgs) Handles MyBase.Load
        Regkey = CreateObject("WScript.Shell")
    End Sub
    Private Sub Button1_Click(ByVal sender As System.ObjectByVal As System.EventArgs) Handles Button1.Click
        Regkey.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 0, "REG_DWORD")
    End Sub
    Private Sub Button2_Click(ByVal sender As System.ObjectByVal As System.EventArgs) Handles Button2.Click
        Regkey.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskMgr", 1, "REG_DWORD")
    End Sub
End Class


No comments:

Post a Comment