README.md

December 5, 2022 · View on GitHub

How to Disable the Taskmanager [For Beginners]

Description

This VERY simple Tutorial shows you how to disable / enable The Taskmanager.

More Info

Submitted On
ByDavid Mann
LevelBeginner
User Rating4.3 (13 globes from 3 users)
CompatibilityVB 6.0
CategoryCoding Standards
WorldVisual Basic
Archive File

Source Code

First You need to add a new Module ad Copy / Paste this Code:

Option Explicit
Dim r As Long

Public Sub CreateKey(Folder As String, Value As String)

Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite Folder, Value

End Sub

Public Sub CreateIntegerKey(Folder As String, Value As Integer)

Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
b.RegWrite Folder, Value, "REG_DWORD"

End Sub

Public Property Get ReadKey(Value As String) As String

Dim b As Object
On Error Resume Next
Set b = CreateObject("wscript.shell")
r = b.RegRead(Value)
ReadKey = r
End Property

Public Sub DeleteKey(Value As String)

Dim b As Object
On Error Resume Next
Set b = CreateObject("Wscript.Shell")
b.RegDelete Value
End Sub

Now you can enable / diable the Taskmanager with one simple Line :

CreateIntegerKey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskmgr", "1"

1 = disabled and 0 = enabled .. hmm this is abit to complicated so lets make a function in your Module:

Public Function Disabletaskmanager()
CreateIntegerKey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskmgr", "1"
End Function

Public Function enabletaskmanager()
CreateIntegerKey "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableTaskmgr", "0"
End Function

TADA! you made 2 new "commands" enabletaskmanger and Disable Taskmanager !! Have Fun !