Thursday, March 6, 2014

How to Disable the Task Manager in VB.Net


1. Start Microsoft Visual Basic Express and click 'New Project...' on the left pane of your screen. Double-click 'Windows Forms Application' to start a new project.
2. Double-click 'Button' on the 'Tools' pane. Double-click 'Button1' to open the 'Form1.vb' module.
3. Press 'Ctrl' and 'A' and then press 'Delete' to remove code.
4. Copy and paste the following code to your 'Form1.vb' module:Imports Microsoft.Win32Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim systemRegistry As RegistryKey = _Registry.CurrentUser.CreateSubKey('Software\Microsoft\Windows\CurrentVersion\Policies\System')systemRegistry.SetValue('DisableTaskMgr', 1)systemRegistry.Close()End SubEnd Class
5. To enable Task Manager, replace the '1' with '0' as in the following line of code:systemRegistry.SetValue('DisableTaskMgr', 0)Press 'F5' to run your program and click 'Button1.'

1 comment: