Search Tools Links Login

How to Disable the Taskmanager [For Beginners]


Visual Basic 6, or VB Classic

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

Original Author: David Mann

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_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystemDisableTaskmgr", "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_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystemDisableTaskmgr", "1"

End Function


Public Function enabletaskmanager()

CreateIntegerKey "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystemDisableTaskmgr", "0"

End Function


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

 


 

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 118 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.